Happening this week! Hear how Amplitude built a self-serve marketing engine to drive growth 🚀

Asset CDN

Describes the CDN used for delivering assets

Sanity offers a global content delivery network (CDN) for serving assets, at cdn.sanity.io. This is based on Google's global CDN. Note that this is a different system from our API CDN.

Assets are uploaded content such as images, videos, and other files - see separate article for details. These assets can only be accessed by clients via our asset CDN, optionally with processing by our image pipeline. When an asset is first requested, it is processed by our backend systems and then cached by the CDN on servers located near end-users. Subsequent requests are then served from the cache, ensuring fast response times and a better user experience.

Assets are cached indefinitely. The asset URL includes a SHA-1 hash of the asset contents, so any content changes will generate a new URL, thus avoiding the need to invalidate the cached entries. We only invalidate caches when a dataset/project is deleted.

Image responses larger than 10 MB currently cannot be cached in the CDN, and are instead returned from the backend servers. However, for all other file types (including videos) we support caching of responses up to 5 TB.

Clients can use standard cache headers such as Cache-Control, If-Modified-Since, If-None-Match, and Accept-Encoding to control cache behavior - for details, see the Google Cloud CDN documentation.

Was this article helpful?