Does Image CDN support caching generated images?
I just tried switching to Netlify Image CDN instead of generating images at build time and I find each time I load a page with a bunch of images it is not much faster than the first. If results were being cached I’d expect it to not sit around processing the thumbnails for so long after the second load. To clarify, I’m talking about CDN-side caching, not browser caching.
Page: Blog | Jimmy Xiao
Project: jimmy-personal-website
Netlify Image CDN | Netlify Docs - custom headers section. We should respect the headers you send.
From that page:
Note that Cache-Control
headers on source images only apply to browsers and CDNs in front of Netlify and not the Netlify Cache itself.
I am wondering how to get the Netlify cache itself to kick in, not any CDN in front of Netlify or browser cache? As far as I can tell, Netlify is regenerating, not caching the images every time and that is causing the page to load very slow.
We cache the generated images on the CDN, but using our default cache-control values for that.
As for page load being slow, you should use lazy-loading and progressivly load high quality images. CDN caching or not, ideally you should not load full-size images during page load.