how to clear web cache in mozilla firefox…including memory, disk and offline cache

Web caching is a mechanism used mostly in browsers where it temporarily stores images, scripts, content and other parts of the webpage locally during the process of web browsing. There are several advantages to web caching while web browsing:

Faster page loads: Web pages contain several parts which might be the same across several pages of a website, such as the logo, scripts and some images among others. Most of these items do not change often, if at all. Fetching the same files multiple times every time a page is loaded is a drain on the resources. Having it available locally and reusing them makes the web pages to load faster.
Reducing Server load: This reduces the load on web servers considerably allowing them to process requests faster. Multiple users requesting and downloading the exact same files repeatedly increases the server load unnecessarily.
Bandwidth reduction: This reduces your own bandwidth usage as well as reduces the network lag incurred while downloading large assets.

Most browsers do such a good job with the web cache, by keeping them fresh and up to date that you hardly ever notice that it is actually working. They remove stale and outdated objects and keep them fresh by re-fetching pro-actively or on-demand, from the server depending on many different heuristics and rules. But sometimes the cache does go stale or be corrupted, especially if the server is getting updated too quickly or if the web page headers are wrong.

If you perceive that a webpage is not rendering correctly or that some or all of the functions on the page is non-responsive or that the content on the page is out-dated, then the first course of action is to clear the cache and re-fetch to freshen up the content directly from the server.

Clearing all your web cache will initially slow down the loading of websites as everything including images and scripts will need to be downloaded over the network. But it is hardly noticeable if you have a fast internet connection.

There are mainly four types of cache that Firefox implements:

Memory Cache: This is the objects that are stored in the memory (RAM), which provides the fastest access time. This is cache where all objects gets cached to initially.
Disk Cache: This is the cache on the hard disk. The objects gets written on to the disk from where it can be read into memory. This might happen when the memory cache is full or when Firefox shuts down.
Offline Cache: This is a feature of HTML5 that allows offline browsing for sites that support it. This caches heavily and pretty much works like the disk cache.
Favicon Cache: The favicons of a website rarely change and they are used by the tabs and the bookmarks. Firefox seems to maintain a different cache for these…

You can see the cache contents in Firefox, by opening the URL about:cache in a browser tab. This will list the caches and the objects that are currently in cache. You can drill down to see all the object URL and the size of each object in the cache.

There are several different ways to clear the cache. Though there is some flexibility in clearing the cache, the easiest and the best thing to do is to blow away your entire cache and start over. The easiest and the preferred way to achieve this is to use the GUI provided by Firefox.

Using GUI to clear web cache

There are couple of options that is available to you here. The first is to clear all web cache using the preferences.

  1. Open the Preferences window. If you have the menu bar enabled then it is in Edit -> Preferences, else it is under the Firefox tab button -> Preferences -> Preferences.clear cache in firefox
  2. In the Preferences window, go to Advanced Panel
  3. Click on the Network tab
  4. Under the section Cached Web Content, click on the Clear Cache or Clear Now button.

This will clear all the cache in the browser, including the memory cache and the disk cache for the entire time period. If you do not want to clear the entire cache, but just part of it from the recent past then you have the following option…

  1. If you have the menu bar enabled, then go to History -> Clear Recent History, else it is under Firefox Button -> History -> Clear recent History (shortcut: Ctrl + Shift + Del)
  2. Select the time range you like to clear from the drop down
  3. Un-check all the check boxes in the details section, leaving just the Cache option check
  4. Click Clear Now button to clear the cache.

The above steps may differ slightly depending on the specific version of the Firefox browser you have installed, but you should be able to find it easily.

Clearing cache automatically

Yet another option is to clear the cache automatically without much of an user interaction. This is often achieved based on a event that happens. The easiest to set up is to clear the cache when the browsers shuts down.

  1. Open the Preferences windowweb cache in firefox
  2. Go to the Privacy Panel
  3. In the History section, select the checkbox next to Clear history when Firefox closes
  4. Click on the Settings button next to it
  5. In the pop-up window make sure that the checkbox next to Cache is checked or selected.
  6. Click OK and close the Preferences


Using Addons to manage Cache

There are several add-ons available that will manage the cache settings for you. These also provide a one-click option to clear web cache.

Cache Status: This is a popular addon that provides support to clear web cache on the fly. It also provides some real time information about the status of the web cache.

Empty Cache Button: Another popular addon with several functionality such as selectively clearing the different types of caches. It also has a keyboard shortcut to clear web cache and reload the page automatically.

The most common reason for having to empty or clear web cache is because a web page is fails to load correctly. If that is the reason, you can probably do some checks and attempts to make sure that the cache is the reason that the webpage is misbehaving before having to clear it.

Force Refresh: A full refresh of the page bypassing the cache is made when you force refresh the page. The keyword shortcut for this is Ctrl + Shift + r .

Another option is to open a window in private mode, try the webpage in that window to make sure it loads as you expect. The private browsing mode does not use cache, which is a good test to see if the web cache needs to be cleared.