By default, each URL is cached based on the path only. BunnyCDN does not respect the Vary header returned from your origin, however, we have a built-in system to make this easy to set up with a few clicks in the dashboard.

pull-zone-vary-cache.png

The Vary Cache configuration, allows you to specify additional parameters for the caching key. Unless you specifically require a certain feature, these should be kept disabled to maximize performance and cache hit rate.

URL Query String

If enabled, the URL query string is used as part of the cache key. For example /image.jpg?v=1 and image.jpg?v=2 are treated as different files in the cache.

Browser WebP Support

If enabled, the cache key will be based on the browser's ability to display WebP images. This key is only applied for URLs with the following extensions: jpg, jpeg, webp, png, gif. This allows you to serve WebP based images from the same URL if your origin server supports that.

User Country Code

If enabled, the user's country code is used as part of the cache key, so a user connecting from France and a user connecting from Germany will have a different caching key. This can be useful for serving translation files from the same URL for example.

The user's country code is forwarded to your origin with each request with the CDN-RequestCountryCode header.

Enabling this will disable purging cache based on a specific URL.

Request Hostname

If enabled, the hostname used with the request is used as a part of the cache key. For example, www.example.com/image.jpg and www.example2.com/image.jpg would be treated as different files in the cache even if linked to the same pull zone.

Enabling this will disable purging cache based on a specific URL.

Was this article helpful?
2 out of 2 found this helpful

Comments

0 comments

Please sign in to leave a comment.