How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Sanity CDN Bandwidth Usage High for Gatsby Site with gatsby-sanity-source

29 repliesLast updated: Nov 30, 2025

Hi everyone, back again with a bandwidth question. I have a Gatsby site that builds everything at run time but all of the images are served over the sanity CDN (I’m using the
gatsby-sanity-source
plugin with
gatsby-image
for this) and the bandwidth usage is sky high vs what I’d expect:

https://www.dropbox.com/s/h32v7tjo3nt5ncu/Screenshot%202021-03-17%20at%2009.02.34.png?dl=0
In the last 30 days the website has had around 1,200 visitors, so not exactly
huge traffic. My usage on Netlify is in the MB’s so it has a tiny footprint there. It’s just Sanity usage which I assume is coming from the images?
Can anyone help me figure this out? I’ve tried lowering the resolution of the images but can’t go much lower without the quality suffering.

I have a theory that users might be having to re-download images every time a new update/build is made to the site, but I have no understanding of how to prove that…
AI Update

Based on what you're describing, I can help explain what's likely happening with your bandwidth usage. The good news is that Sanity's image CDN has very aggressive caching that should work in your favor, but there are a few potential issues with the Gatsby setup that might be causing problems.

How Sanity's CDN Caching Works

Sanity's Asset CDN uses content-addressable URLs with SHA-1 hashes, which means the URLs include a hash of the asset contents. This is actually great for caching because:

The CDN sets appropriate cache headers that should allow browsers to cache images aggressively, so users shouldn't need to re-download images on every visit.

Why Your Bandwidth Might Be High

Your theory about re-downloads on every deploy could be partially correct, but it's likely related to how gatsby-source-sanity and gatsby-image are handling the image URLs. Here are the most likely culprits:

How to Debug This

Potential Solutions

The bandwidth you're seeing is likely legitimate traffic, not a caching problem with Sanity's CDN itself. The CDN is doing its job correctly - the issue is probably the volume of image variants being served and the number of requests per visitor.

Show original thread
29 replies

Was this answer helpful?

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.

Related contributions