moving cache to RAM instructions making the rounds

25585 views
Skip to first unread message

Asa Dotzler

unread,
Nov 12, 2010, 2:24:31 PM11/12/10
to
http://gizmodo.com/5688295/speed-up-firefox-by-moving-your-cache-to-ram-no-ram-disk-required

This information has been making the rounds on twitter and tech blogs
for a few days now. Just wanted to see if anyone thought there was
anything immediately bad about it (will it hose users?) and if so
whether or not we should say or do something to prevent users from doing
this.

- A

> Once you get into about:config, type browser.cache into the filter bar
> at the top. Find browser.cache.disk.enable and set it to false by double
> clicking on it. You'll then want to set browser.cache.memory.enable to
> true (mine seemed to already be set as such), and create a new
> preference by right clicking anywhere, hitting New, and choosing
> Integer. Call the preference browser.cache.memory.capacity and hit OK.
> In the next window, type in the number of kilobytes you want to assign
> to the cache (for example, typing 100000 would create a cache of 100,000
> kilobytes or 100 megabytes). A value of -1 will tell Firefox to
> dynamically determine the cache size depending on how much RAM you have.

Boris Zbarsky

unread,
Nov 12, 2010, 2:42:46 PM11/12/10
to
On 11/12/10 2:24 PM, Asa Dotzler wrote:
> http://gizmodo.com/5688295/speed-up-firefox-by-moving-your-cache-to-ram-no-ram-disk-required
>
> This information has been making the rounds on twitter and tech blogs
> for a few days now. Just wanted to see if anyone thought there was
> anything immediately bad about it (will it hose users?) and if so
> whether or not we should say or do something to prevent users from doing
> this.

The main bad things are:

1) This will slow down some plug-ins (Adober reader, for certain)
which rely on being able to get to the data as a file; if we can't
store it on disk in our cache, we'll have to stream it to a temp
file instead.
2) The size of the memory cache is capped at a much lower number than
the size of the disk cache; it's a lot easier to fill it up and
start evicting things.
3) The disk cache, unlike the memory cache, persists across restarts.
This means that you trade off slower startup (due to none of your
restored tabs being in cache) and slower initial visits to all
sites for slightly faster repeat visits to sites, as long as you
didn't visit too much stuff in between.
4) We have ongoing work for Fx4 to make use of the memory cache as
well as the disc cache for the same content (right now we use one
or the other but not both for any given resource). Once we do
that, you'll get all the benefits of this "tweak" without the
drawbacks... and using the tweak at that point will be a strict
loss.

-Boris

Justin Dolske

unread,
Nov 12, 2010, 5:39:44 PM11/12/10
to
On 11/12/10 11:42 AM, Boris Zbarsky wrote:

>> This information has been making the rounds on twitter and tech blogs
>> for a few days now.
>

> The main bad things are:
>

>[...]

When this kind of thing happens, I think we should -- at minimum --
rename the prefs. We've got a lot of crusty footgun prefs around, and
when widespread advice is to fiddle with them (without understanding of
the tradeoffs, or outright brokenness the advice might cause), then our
users suffer and the browser takes the blame.

Of course, the even better solution is to look for ways to eliminate the
need for prefs and dials, and just make the browser do the right thing.
Obviously that's harder.

Justin

Ron Hunter

unread,
Nov 12, 2010, 7:49:11 PM11/12/10
to
I have long ago dispensed with the disk cache as it just slows things
down, and overworks my HD. I have 4GB of RAM, and seldom use more than
half of it for everything that is running. I have always deleted the
disk cache after a session anyway as I don't want old data. Some of us
don't WANT to restore a session.
Bottom line, this is an advantage (the hack) for many users, not so much
for others. May slow some users, or have other repercussions, but I
haven't seen any, yet.


Ron Hunter

unread,
Nov 12, 2010, 7:51:02 PM11/12/10
to

Justin,

Reread that and see if you don't think it is just a bit 'elitist'.
We know better what you want and need than you do, so just close your
eyes, and do it OUR way. Sigh.
I don't think users would perceive this as an advantage to them, even if
some benefit did accrue from it.

Kevin Brosnan

unread,
Nov 13, 2010, 12:05:31 AM11/13/10
to Asa Dotzler, dev-apps...@lists.mozilla.org
There is an open bug about extension install breaking if you disable
the disk cache. Not sure if it is still valid
https://bugzilla.mozilla.org/show_bug.cgi?id=262854

> _______________________________________________
> dev-apps-firefox mailing list
> dev-apps...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-apps-firefox
>

Ron Hunter

unread,
Nov 13, 2010, 3:28:01 AM11/13/10
to
On 11/12/2010 11:05 PM, Kevin Brosnan wrote:
> There is an open bug about extension install breaking if you disable
> the disk cache. Not sure if it is still valid
> https://bugzilla.mozilla.org/show_bug.cgi?id=262854
>

That one is quite old, and I am sure, no longer the case as I routinely
install extensions with disk cache set to 0.

wktra...@gmail.com

unread,
Jan 11, 2015, 11:59:34 AM1/11/15
to
It also stops the portable version of Firefox from crashing if the disk it is on is temporarily removed, witch counts as a big plus for me at least. Cable is a bit faulty and instead of having to deal with a lobotomize browser, I get to go on happily without having to do anything ever (tiny exaggeration)

labob...@gmail.com

unread,
Dec 14, 2015, 11:41:53 AM12/14/15
to
1a) Doesn't that mean plug-ins do not respect that setting?

1b) Will they stop from working if I disallow them write access?

1c) Why isn't Firefox redirecting plug-ins disk access to ram or at least makes the plug-ins respect the settings by force?

2) Do Firefox have a setting to change the memory cache size? If not, why?

3) Is this true for users who always use "Private Browsing" too?

4) How is that work coming along five years later?

Regards,
me

»Q«

unread,
Dec 14, 2015, 1:37:40 PM12/14/15
to
In <news:4df33bb1-ea65-42a5...@googlegroups.com>,
labob...@gmail.com wrote:

> How is that work coming along five years later?

You should as in the successor to this list,
<https://mail.mozilla.org/listinfo/firefox-dev>. Probably giving a
link to the old thread at Google Groups would be helpful.


Reply all
Reply to author
Forward
0 new messages