SVGs Are Not Caching When Serving Over CDN
Good catch! This was a bug that has been fixed. According to the Sanity Answers thread from June 2021, a Sanity team member confirmed this was indeed a bug and mentioned it would be fixed in a pending release.
The issue you described is exactly right - PNGs and other image formats were getting proper Cache-Control: public, max-age=31536000, s-maxage=2592000 headers, but SVGs weren't receiving any cache-control headers despite having the correct Content-Type: image/svg+xml header.
Since this bug was acknowledged and fixed back in 2021, if you're still experiencing this issue today, here are a few things to check:
Verify the URL structure: Make sure your SVGs are being served through Sanity's Asset CDN at
cdn.sanity.io. The CDN should automatically handle caching for all image types including SVGs.Check if it's a recent upload: The Asset CDN caches responses indefinitely once processed. If you recently uploaded the SVG, try accessing it a few times to ensure it gets cached properly.
Browser caching: Clear your browser cache and test again to ensure you're not seeing old cached responses without headers.
Test the actual CDN response: Use curl or browser dev tools to inspect the actual response headers from
cdn.sanity.ioto confirm whether the headers are present.
If you're still seeing missing cache-control headers on SVGs after checking these items, I'd recommend reaching out to Sanity support or posting in the community Discord as this should definitely be working now. The Asset CDN is built on Google Cloud CDN infrastructure and should treat all image/* content types consistently with proper caching headers.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.