sanity-io / sanity-template-gatsby-portfolio

A Gatsby portfolio site powered by Sanity for https://www.sanity.io/create
https://www.sanity.io/create/?template=sanity-io%2Fsanity-template-gatsby-portfolio
69 stars 18 forks source link

Gatsby not using cdn APIs even when adding useCdn in gatsby-source-sanity plugin options #60

Closed turutupa closed 2 years ago

turutupa commented 3 years ago

Hi!

Perhaps this is a misunderstanding of some sort from side as I am new to Sanity. Nonetheless, I added the useCdn parameter in gatsby-config.js under the gatsby-source-sanity plugin options as such

...
{
      resolve: "gatsby-source-sanity",
      options: {
        ...clientConfig.sanity,
        token,
        useCdn: true,   // <- here
        watchMode: !isProd,
        overlayDrafts: !isProd && token
      }
    }
...

But in my Sanity project I see API CDN Requests 0 of 500k and 24h have gone by (in case it wasn't updating)

Is there anything else I have to modify besides adding useCdn for it to work? Thanks in advance

Nagaraju-Katta-Webonise commented 2 years ago

Hello @turutupa have you solved the issue ?

turutupa commented 2 years ago

@Nagaraju-Katta-Webonise this was long time ago, I don't remember very well now. But I think this was the expected behavior for some reason. Perhaps cdn was no longer supported. I'm no sure now, sorry.