Firefox Cache in RAM
- posted:
2025-05-13
HTTP is designed to cache objects - such as html pages, jpeg images, css stylesheets, and etc. - as much as possible [1], because that way it not only reduces the load on the server, but also saves bandwidth for users of the HTTP service. However, it is estimated that only a fraction of cached objects will be reused, usually about 30%, because of very short object expiration time, updates or simply user behavior (loading new pages instead of returning to the ones already visited) [2].
In Firefox (the web browser of my choice), cached objects can be stored either in memory or on disk. Disk caching results in frequent disk writes, which could reduce the lifespan of disks, especially for SSDs (solid-state drives). Memory caching, on the other hand, provides superior speed and enables unlimited read/write cycles. Therefore, memory caching would be a better choice.
To configure Firefox to cache in memory only (with disk caching disabled), open the page about:config:
Set browser.cache.disk.enable to false for disabling disk caching.
Set browser.cache.memory.enable to true for enabling memory caching.
Set browser.cache.memory.capacity to the desired amount of KB for the maximum memory to be used for memory caching - by default, it is set to -1 for automatic cache size selection [3], which is 32768 KB for my laptop.
After that, open the page about:cache to check if the new settings are in effect - it should be something like this:

Thanks for reading :)