Browser caching

24 July 2013

Tags

  • Fairy Tale Twist
  • Performance

According to Google developer tools we’re not specifying an expiry date or maximum age in our HTTP headers for static resources. This applies to our static data from the CDNs, not zbar, html, etc… as this is setting Cache control. “Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.” “Given the URL of a resource on the web, the browser starts by checking its local and application caches. If you have previously fetched the resource and the appropriate cache headers were provided (ExpiresCache-Control, etc.), then it is possible that we may be allowed to use the local copy to fulfill the request” https://developers.google.com/speed/docs/best-practices/caching#LeverageBrowserCaching Most notably: Use the Cache control: public directive to enable HTTPS caching for Firefox. Some versions of Firefox require that the Cache control: public header to be set in order for resources sent over SSL to be cached on disk, even if the other caching headers are explicitly set. Although this header is normally used to enable caching by proxy servers (as described below), proxies cannot cache any content sent over HTTPS, so it is always safe to set this header for HTTPS resources.