In the fifteen or so years I’ve been using the internet, the connection speed has gotten faster and faster. In the mid-2000s, when using the family computer to look up cheat codes for video games, it was on a dial-up connection, excruciatingly slow by today’s standards and further limited by my parents’ telephone calls – and I’ll never forget when I realized that Internet Explorer could save a web page to the hard drive. I could simply save all the pages with the cheat codes I wanted and look them up instantly at any time, regardless of whether the telephone line was free.

Caching is like that, but your browser does it for you. Unfortunately, in the last couple of years, I’ve started to notice that Firefox doesn’t seem to load pages from cache as much as it used to. And even though my connection speed is faster than ever, it is very noticable. The internet still isn’t instant, and furthermore, sites are becoming more and more heavyweight.

First, I thought it might be a setting in Firefox that has been changed. Perhaps Mozilla figured that modern connection speeds are high enough to make caching unnecessary. But, after some research, I found that the reason is that more and more sites have been migrating to HTTPS (and regrettably disallowing HTTP access) – which wouldn’t be a problem if Firefox cached pages served over HTTPS, but it turns out that Firefox refuses to do so, unless the page is explicitly served with a Cache-Control: public header. And because there is no preference that changes this, the only solution is to manually change the headers of all pages that Firefox loads.

The simplest way is to use an extension. Here are my suggestions:

I’ll describe the setup that has worked for me. There are probably other combinations that work, but I haven’t tried all of them.

  1. Filter (remove) any Content-Control header.
  2. Add a Pragma header (no value needed).

After setting this up, make sure that the browser.cache.check_doc_frequency preference is set to an appropriate setting (you probably want 0 or 2 – I use 0). When debugging your cache preferences, you can use about:cache to check whether pages are being stored.

Also, I’ve seen some people suggest disabling disk caching and relying completely on in-memory caching. If you have the memory for it (I unfortunately don’t), this is a very good idea. You could do something along the following lines:

  1. Set browser.cache.disk.enable to false.
  2. Set browser.cache.memory.enable to true.
  3. Increase browser.cache.memory.max_entry_size (in kilobytes).

The reason you’d want to do this is security. If you visit pages that serve private, sensitive content, like your online bank, you might not want those pages saved to the hard disk.