Cloud Flare not caching images when cache-control is public

  • Updated

When images have a their Cache-Control header set to "PUBLIC" CloudFlare's CF-Cache-Status header is set to "MISS" causing images not to be served from the CDN cache even when the web.config file is properly configured to allow caching of images.

This can sometimes be caused by JavaScript doing image handling or manipulation. This can be tested by disabling JavaScript in your browser and doing a hard refresh of the page using crtl+F5. If doing this gives you a CF-Cache-Status header of "HIT" then there is something in the JavaScript that is causing CloudFlare to not serve a cached copy of the image, you will need to do a code review on your JavaScript to identify what might be causing this.