If Bunny Optimizer is enabled, WebP and URL Query String vary
settings are automatically turned on for image files.
Configure Vary Cache
1
Open your Pull Zone
Go to your Pull Zone in the dashboard and click Caching in the side menu.
2
Open the General panel
Click General inside the Caching section.
3
Select Vary Cache behaviors
Enable the desired Vary Cache options (WebP, AVIF, Query String, etc.).
4
Save your configuration
Click Save Vary Configuration.

Vary Cache settings
WebP support
Stores separate cached versions based on whether the browser supports WebP images. When enabled, browsers that support WebP receive WebP-optimized content while others receive the original format—all from the same URL. Only applies to these extensions:jpg, jpeg, webp, png, gif
AVIF support
Similar to WebP, this varies the cache based on the browser’s ability to display AVIF images. Useful for serving next-gen image formats to supported browsers.URL Query String
By default, query strings are ignored when constructing the cache key. These URLs would all return the same cached file:- Dynamic responses generated from query parameters
- Cache busting via versioned URLs
- Bunny Optimizer transformations
User Country Code
Includes the end-user’s GeoIP country code in the cache key. Your origin can return different content based on theCDN-RequestCountryCode header, and each country-specific version is cached separately.
Requested Hostname
Uses the hostname from the request as part of the cache key. With this enabled, requests tocdn.example.com and example.b-cdn.net on the same Pull Zone are cached separately.
This allows your origin to return different content based on the requested domain. Combine with the Forward Host Header setting so your origin receives the actual hostname.
Mobile/Desktop
Varies the cache based on whether the request comes from a mobile or desktop device, determined by the User-Agent header. When enabled, Bunny sends aCDN-MobileDevice header to your origin with a value of true or false. Your origin can use this to serve device-appropriate content (such as different image sizes), and each version is cached separately.
Cookie
Varies the cache based on specific cookie values. When enabled, enter the cookie names you want to use as part of the cache key.Custom header-based vary is available via internal configuration. Contact
support@bunny.net if you need to vary cache on a
header not listed here.
Cache key impact
Each vary setting you enable multiplies the number of cached versions per URL:| Setting | Cache versions per URL |
|---|---|
| WebP | 2 (supported / not supported) |
| AVIF | 2 (supported / not supported) |
| Mobile/Desktop | 2 (mobile / desktop) |
| Country Code | Up to 195+ (one per country) |
| Query String | Unlimited (one per unique query) |
| Cookie | Varies by cookie values |
2 × 2 × 195 = 780 cached versions of a single URL.