Back in July last year (how time flies), I investigated how we could use caching in our products to improve the user experience. This resulting in creating a framework for serving content that can be cached on the client. We now use this for Jira, Confluence and Bamboo.
The idea is that some resources (css, images, javascript), never change between releases, and so we add ‘caching headers’ to say cache it forever. You can see how we have achieved that by using on the online services:
Test caching for Bamboo
However, when browsing certain sites like – these sites still felt very slow.
It turns out that SSL was the culprit! By default, firefox does not cache SSL content on disk, regardless of what the caching headers say. There is a property called browser.cache.disk_cache_ssl which by default if ‘false’. Meaning that all content is cached in memory.
Turns out that Firefox also allows you to see what is in your browser’s cache – type ‘about:cache’ into the location bar. With that property set, no https site will have anything in the memory cache.
Because the memory cache is so much smaller than the disk cache, the javascript and css etc will be pushed out much sooner than if it was on disk.
Turns out that Internet Explorer caches things to disk (correctly observing the caching headers), and there is an open bug for firefox: Change browser.cache.disk_cache_ssl default to true.
Note that if you do manually change the value to true, beware of this bug: mixed http/https warnings after enabling browser.cache.disk_cache_ssl.
Note that if you go through the proxy server, you probably won’t see the slowness as much, as they will be cached by the proxy server.
Update: – this is now fixed in Firefox 3 if you set the Cache-control header to public. We will be updating all our applications shortly

When caching is not caching