Speed up Firefox page loading time without using a RAM disk
Yesterday we wrote about moving the cache of Firefox or Chrome onto a RAM disk. Instead of loading cached images and data from the hard drive, it loads from memory, which is a lot faster. It turns out, though, that Firefox can do this without using a RAM disk -- you can simply do it with about:config.Just follow these instructions -- and don't worry, if you mess it up, you won't break anything.
- Type about:config into the address bar
- Type browser.cache into the Filter field
- Set browser.cache.disk.enable to false (double click it)
- Set browser.cache.memory.enable to true (double click it)
- Right click > New > Integer; type browser.cache.memory.capacity; press OK
- Type in 100000 (this is equivalent to 100 megabytes); press OK
- Close all Firefox tabs and windows, and then restart the browser

If you want more than 100 megabytes of cache -- if you have lots of spare memory, or you're prone to mammoth browsing sessions -- type in 500000 instead for 500 megabytes of cache. To confirm everything is working, visit about:cache and you should see some 'Memory cache device' information.
I'm currently unable to benchmark this change (Firebug doesn't work with FF4 Beta 7!) but in theory it should be just as fast or faster than the RAM disk approach.. Lee has been using it for a few hours and he says page loads are much faster. If you use Firefox, try it out and let us know whether it feels faster or not!
Thanks to commenter danielkza for the tip!













Comments
36
Subscribe to commentsJakurbNov 11th 2010 4:30PM
Neat!
Aaron OrtizNov 11th 2010 2:53PM
This will only work as long as you don't power off your computer or close Firefox. Once you do, the cache is lost. And, the first time you load a resource, it will be the same speed as before, but much faster for subsequent loads.
MattNov 12th 2010 11:15AM
Yeah, this seems like a really bad idea for most people. It would be nice if it would move the memory cache to disk when you close Firefox, but it does not.
sunk818Nov 11th 2010 3:18PM
Firefox itself won't load faster unless you install firefox portable to a ram drive. Firefox will record history, downloads, etc to the profile so it will improve performance on a ram drive. But you also lose that memory for other apps and risk data loss and/or corruption because you run it ona ram disk. Too risky for me, but about:config change is a no brainer. Completely safe and I think firefox should allocate 1mb to disk cache by default. This would be the single most simple change to provide an awesome benefit to the mass of firefox users.
GeekTechNov 11th 2010 6:42PM
So, this means that one can simply put "browser.cache.memory.capacity" integer value "-1" for auto or:
Physical RAM Memory Cache (in KB)
32 MB 2048
64 MB 4096
128 MB 6144
256 MB 10240
512 MB 14336
1 GB 18432
2 GB 24576
4 GB 30720
8 GB and up 32768
Also, according to the mozillaZine page:
"Caveats:
browser.cache.memory.enable must be true for this preference to take effect.
Lowering this value causes less memory to be used but also increases the load time of previously visited pages and dialogs.
Raising it has the opposite effect.
To view current memory cache usage, put about:cache?device=memory in the Location Bar
This preference does not exist by default in applications other than Thunderbird.
Recommended settings
Users who are having problems and want to lower memory consumption can try setting the integer value to something lower than the memory cache setting given in the above table. 4096, which was the previous default value, is a good place to start because it will decrease memory usage for users with more than 64 MB RAM. Users who have no problems with memory should leave the setting at -1."
Most of the people these days use computers and laptops with about 4GB of RAM anyways, so if I can speed up my browsing experience I will of course do it. I would allocate about 256MB. That would be enough for a modest browsing session.
joNov 26th 2010 1:19AM
@GeekTech When I went to :cache?device=memory I was redirected to Facemoods. I'm thinking that isn't a good thing. Right? If it is very wrong what should I do?
Help please.
Thank you
Joanne
qwertyblueNov 12th 2010 8:17AM
I'm seeing a huge difference using Simple Mail, the only reason I use Firefox in work. Before there were huge delays doing tasks like switching from inbox to sent or searching through emails (thousands of emails) but now switching from inbox to sent is instant and searching takes a few seconds. Thanks for this Sebastian!
larsNov 12th 2010 10:20AM
The only thing you're doing different, is disabling disk cache (so the cache is no longer persistant), and increasing the memory cache, which might lead to faster loading times.
thegeekNov 15th 2010 5:51PM
Does this also work for firefox on mac's?
Because i did it, but whenever i check about:cache, it says 0KiB in use.
Alan B'StardNov 25th 2010 6:44PM
What do I do if I don't have a "Filter field" ?
Dwight StegallNov 19th 2010 12:11AM
I tried this in Firefox 4.0 Beta 7. It worked fine until I tried watching videos at Megavideo. When I would close that tab the video would continue to play. Even if I loaded another video in another tab it would still continue to play. I had to restart the browser to get it to stop. Changing the browser.cache settings to their defaults made this problem disappear. I didn't try this at other video sites. So it could have just been a Megavideo problem.
I use an Asus G73JH with Windows 7 Home Premium 64-bit.
Sebastian AnthonyNov 19th 2010 5:32AM
Haha... that's an interesting bug :)
I can't think why a RAM cache would do it though... so it's either Megavideo, or a crazy-ass bug in that version of Firefox.
Alan B'StardNov 19th 2010 6:29AM
If my Firefox does not have a "Filter field" then how do I get one ?
Sebastian AnthonyNov 19th 2010 6:30AM
I'm not sure. Sounds like the kind of thing a quick google search would help with.
Failing that, reinstall.
KrazyCalvinNov 21st 2010 2:33PM
I don't know what is going on because now a while into using this it seems to be lagging up the browser more. I keep having situations where it sits for 15 or 20 seconds without showing its loading anything and if i open a new browser and try to go to a different site it just does the same thing. It had never done this before.
Sebastian AnthonyNov 29th 2010 5:37PM
@(Unverified) I'm thinking you might have a spot of malware, or something like that :) Grab Malwarebytes!