astro-sanity icon indicating copy to clipboard operation
astro-sanity copied to clipboard

Add caching logic

Open regisphilibert opened this issue 1 year ago • 1 comments

It would be great if the plugin handled caching of API responses like Astro Image is doing.

Use case

I've stored some site metadata on a Sanity dataset (site title, site description, site default image etc...) so that SEO data or the footer can be populated with it.

Now when I invoke this function in the footer component to fetch the site description, it dramatically slows down build time. I'm using use: Cdn which must speeds up the response, but it seems each pages still needs to wait for it in order to be built. (~ 200ms)

This also drastically increases API/CDN stats.

regisphilibert avatar Jan 05 '23 19:01 regisphilibert