Understanding Smart Cache

By default, bunny.net will cache all resources returned by the origin server that contain cacheable headers such as Cache-Control or Expires. In case of server misconfiguration, this can result in incorrect caching of sensitive or personal information.

 

How does Smart Cache work?

Smart Cache solves this by only caching responses with specific extensions and MIME types. This means dynamic content is not cached and will always be proxied to the origin server. If the request is cacheable by Smart Cache, the standard Cache Expiration Time setting logic applies to determine the caching time.

 

How do I enable Smart Cache?

To enable Smart Cache, open your Pull Zone settings. Then, click on the  Caching settings in the Pull Zone menu. There, you can enable or disable the Smart Cache setting by clicking on the Smart Cache checkbox at the top of the page. This will enable Smart Cache for you.

 

For Pull Zones that are accelerated by DNS, Smart Cache is already enabled by default.

 

How to override Smart Cache?

To override smart cache, the Override Cache Time Edge Rule can be set up. This will override the decision created by the Smart Cache system and allows you to cache otherwise uncacheable extension or MIME type.

 

List of cacheable extensions:

3g2 3gp 7z ai asf avi avif apk
bin bat bmp bz2 class css csv dat
doc docx dll dmg ejs eot eps exe
flac flv heic gif gz ico iso jar
jpg jpeg js m3u8 m4u mid midi mkv
mp3 mp4 mpa mpg odt ogg otf pdf
pict pls png ppt pptx ps psd rar
srt svg svg2 swf tar tif tiff ttf
vob webm webp woff woff2 wav wma xls
xlsx zip zst ts txt yuv    

 

MIME types that will not be cached:

text/html application/json application/xml  

Table of Contents

Was this article helpful?
70 out of 77 found this helpful