How to move Firefox's cache out of Puppy's savefile

How to do things, solutions, recipes, tutorials
Message
Author
Barkingmad
Posts: 156
Joined: Fri 21 Nov 2008, 17:20

How to move Firefox's cache out of Puppy's savefile

#1 Post by Barkingmad »

I've been looking at the various ways to keep savefile clutter down but moving Firefox's cache seemed hard so after a bit of thought I tried the following.

Using Rox I found the current location of the cache. On my installation it's at ~/.mozilla/firefox/nunzpnku.default. Inside there there is the cache and a load of config type stuff. Note you'll need to set Rox to "show all files" so see .mozilla in the first place :)

So I'd know what it was I made a folder in the root of my HD called "Firefoxstuff" then moved nunpnku.default into it then dragged back to ~/.mozilla/firefox and chose "make link here".

Now the free savefile space has increased and Firefox starts up and seems to run the same as ever so it seems to have worked.

This was much quicker to do than to type or read :lol: so hope it's handy for someone.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

I suppose this would also work if you moved nunpnku.default into /tmp. Since the contents of /tmp are not saved anywhere, the cache would be wiped clean upon rebooting. Or do I misunderstand how this works?

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#3 Post by mikeb »

I find setting the cache to 0MB and clearing it is pretty fast too.

mike

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#4 Post by sunburnt »

Mikes way is the proper way to do it, there`s 2 cache setting as I recall.

For koulaxizis`s Firefox-23 the cache is: /root/.cache/mozilla/firefox
So to automate it, I added these lines to: /etc/rc.d/rc.local

Code: Select all

CACHE=/root/.cache/mozilla
TMP=/tmp/mozilla_cache/firefox

mkdir -p $TMP		# put Firefox cache in:  /tmp
if [ ! -L $CACHE ];then
	rm -rf /root/.cache/mozilla
	ln -s $TMP $CACHE
fi
Last edited by sunburnt on Thu 12 Dec 2013, 08:10, edited 2 times in total.

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#5 Post by RetroTechGuy »

Flash wrote:I suppose this would also work if you moved nunpnku.default into /tmp. Since the contents of /tmp are not saved anywhere, the cache would be wiped clean upon rebooting. Or do I misunderstand how this works?
There would have to be some new trick... I had tried moving the file out of /root/.cache/ onto /mnt/home/ and linking it back.

On the next reboot it "forgot" about the sym link, and proceeded to fill up /root/ again... :evil:

It would seem like your idea might fix it... I just keep emptying the cache folder at the moment...
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#6 Post by sunburnt »

RetroTechGuy; Look at my post just above yours...

The CACHE path apparently is different even for different builds of Firefox.
So substitute your`s for mine in the script.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#7 Post by MochiMoppel »

sunburnt wrote:Mikes way is the proper way to do
:lol: That's a workaround, but not an answer to the question of the thread.

Firefox allows to set the cache location:
Go to address about:config => accept warning => right click => New => String => type browser.cache.disk.parent_directory => type new cache location, e.g. /tmp/ffcache => restart Firefox.

In Opera setting the cache location works similarly: opera:config =>Cache Directory4 => type new location.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#8 Post by mikeb »

That's a workaround, but not an answer to the question of the thread.
well I would be disagreeing :)
Unless you are using dial up, a cache is a bit pointless (pages are cached in ram anyway) so disabling it is configuring the system to suit the circumstances. Internet Explorers (horror) caching methods are a different matter as its shared with the operating system but even that allows setting to 1MB.
It also obiviates the need for all this messing around.

mike

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#9 Post by Moat »

MochiMoppel wrote: Firefox allows to set the cache location:
Go to address about:config => accept warning => right click => New => String => type browser.cache.disk.parent_directory => type new cache location, e.g. /tmp/ffcache => restart Firefox.
:shock:

:D Whoa... cool! I'll have to try this one, as trying to resolve the Firefox caching>savefile issue via drag/drop/symlink back has not been sucessful, as Firefox always annoyingly re-creates the entire ~/.Mozilla paths apon the next boot. I'm indeed on dialup, so I do much prefer caching enabled!

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#10 Post by mikeb »

I'm indeed on dialup, so I do much prefer caching enabled!
No problemo in that case amd sounds like you have the answer :)

Definately not something for /tmp in either case.

mike

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#11 Post by MochiMoppel »

mikeb wrote:well I would be disagreeing
I was objecting to sunburnt's "proper way", not your workaround.

I seldom use Firefox and I don't know how much cache is kept in RAM, there seems to be no setting (in Opera there is). Low bandwidth (or low RAM :wink: ) is only one reason to keep the cache. Offline browsing could be another one. And when you create a cache folder outside of Puppy - either via symlink or about:config - you have access to cached content long after you've closed Firefox and/or Puppy - without filling pupsave.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#12 Post by mikeb »

In 12 years I still don't know why offline browsing exists... but thats just me...I just save pages or bookmark.

The page cache is pretty big...its only configured in about:config and never had to touch that one but if ram was limited its definately worth a tweak. That covers browsing back and old tabs basically.

Not sure of how the cache could be used apart from through the browser.

It just reminds me of all the outside the save file linking I used to do... gets a bit messy and each system change means doing it again.

mike

Barkingmad
Posts: 156
Joined: Fri 21 Nov 2008, 17:20

#13 Post by Barkingmad »

WOW !!! I didn't think my first attempt at a "how to" would produce this much debate :o

I had read something about doing it in about:config but didn't realy understand what I should do there so tried the way I described in the first post.

For me this does reduce savefile use and doesn't seem to have broken anything so I'm happy with that.

I think this thread though shows how Puppy lets you bend it how you like it -- non of these ways can be wrong if they do what the user needs so they must all be right 8)

I'm ducking out now having exceded my expertese anyway

Will

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#14 Post by mikeb »

non of these ways can be wrong if they do what the user needs so they must all be right
Ever thought of a career in the diplomatic corps?

mike

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#15 Post by puppyluvr »

:D Hello,
I just move the whole mozilla dir to mnt home so all my puppies can share it.
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#16 Post by RetroTechGuy »

MochiMoppel wrote:
sunburnt wrote:Mikes way is the proper way to do
:lol: That's a workaround, but not an answer to the question of the thread.

Firefox allows to set the cache location:
Go to address about:config => accept warning => right click => New => String => type browser.cache.disk.parent_directory => type new cache location, e.g. /tmp/ffcache => restart Firefox.

In Opera setting the cache location works similarly: opera:config =>Cache Directory4 => type new location.
Thanks! I'll be testing that out... :D
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#17 Post by RetroTechGuy »

puppyluvr wrote::D Hello,
I just move the whole mozilla dir to mnt home so all my puppies can share it.
I tried moving the cache folder out... As soon as I reboot, and load FF it creates a new one (wiping out my symbolic link)... Grrrr.....

This fix looks promising (and should be retained when FF upgrades itself to version 476... ;-) )
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#18 Post by sunburnt »

My code puts the cache in /tmp, so it`s self-cleaning at every shutdown. No Save is used.

Setting Firefox`s configs. helps, but they still take up Save file space.!

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#19 Post by RetroTechGuy »

sunburnt wrote:My code puts the cache in /tmp, so it`s self-cleaning at every shutdown. No Save is used.

Setting Firefox`s configs. helps, but they still take up Save file space.!
I just applied MochiMoppel's modification. Looks to be working...

Now I just have to do it to a few more systems...
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#20 Post by sunburnt »

Yes, that`s the Firefox configs spoken of, I believe there`s 2 cache settings in it.

# Note: You will find that it still grows the cache. Just not as bad as before.
Only moving the cache to /tmp solves the problem completely.
There`s no need for it to be on a partition, it`s slower, and there`s no reason to save it.

Post Reply