LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-27-2010, 02:45 PM   #1
Changes
Member
 
Registered: Oct 2008
Posts: 190

Rep: Reputation: 16
Disabling Chrome's cache by linking it to /dev/null


I've got Google Chrome installed on Debian, with the whole system running off a SD card in my EeePC. SD cards aren't fast and flash memory isn't durable, so I want to disable Chrome's cache to speed things up and make my card last longer.

Thing is, Chrome doesn't have an option to do so (stupid); command line arguments can be used to specify a cache size and directory, but any app that opens the browser directly will bypass the arguments.

So I thought - what if I delete Chrome's cache folder and create a symlink in its place pointing to /dev/null? (ln -s /dev/null {home}/.cache/google-chrome/Cache) This should cause all cache data to be instantly destroyed, effectively obtaining the same result as disabling cache altogether would.

Am I missing something, or would this work?

Thanks.

Last edited by Changes; 09-27-2010 at 02:47 PM.
 
Old 09-27-2010, 02:50 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,090

Rep: Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474
unknown but might work like linking the flash .macromedia/Flash_Player/#SharedObjects to /dev/null
but i do not know if there will be any unintended consequences ?

let us know how it goes
 
Old 09-27-2010, 02:52 PM   #3
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Your idea might work - at the least, it's worth a try, and can be undone if it doesn't help.

Another idea would be to create a wrapper script which starts up chrome with the proper command-line arguments to fix your cache. You would have to rename chrome to something else (like chrome.orig perhaps) and then create a wrapper script in the same location, called chrome, which would launch the chrome.orig binary, with your options. This would prevent third-party apps from bypassing the command-line options.

Aside: I don't think that completely disabling the cache is a great idea; for example, this means your browser would have to repeatedly download every single little image, icon, etc., every time it needed to display one. That might slow things down more than you like. But, no harm in giving it a try.
 
Old 09-27-2010, 04:08 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
I want to disable Chrome's cache to speed things up and make my card last longer.
This is an old post, but you should read it and then, perhaps, stop worrying about write limits or making your card "last longer".
 
Old 09-28-2010, 07:47 AM   #5
Changes
Member
 
Registered: Oct 2008
Posts: 190

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by tredegar View Post
This is an old post, but you should read it and then, perhaps, stop worrying about write limits or making your card "last longer".
I've read that already. First, my flash device isn't a SSD, it's a no-brand SD card, and I wouldn't be surprised if it lasted far less. Second, the "make it last longer" is only part of the reason why I want to disable caching; if I was writing on an equally slow hard disk, I'd want to disable it there, too.

Quote:
Originally Posted by GrapefruiTgirl View Post
Your idea might work - at the least, it's worth a try, and can be undone if it doesn't help.
Hmm... seemed to work for a while, but at next boot Chrome deleted the symlink and recreated the folder. Is there any way I can modify the link so it can be read from and written to, but not deleted? I'm less familiar with the workings of chmod and such than I should be.

Quote:
Another idea would be to create a wrapper script which starts up chrome with the proper command-line arguments to fix your cache. You would have to rename chrome to something else (like chrome.orig perhaps) and then create a wrapper script in the same location, called chrome, which would launch the chrome.orig binary, with your options. This would prevent third-party apps from bypassing the command-line options.
Yeah, I'll try that. From posts I've read around, it seems you can't specify a cache size of zero or it won't work at all - but you can specify the cache folder as /dev/null in the arguments. That oughta work.

Edit: it does work. Thanks

Quote:
Aside: I don't think that completely disabling the cache is a great idea; for example, this means your browser would have to repeatedly download every single little image, icon, etc., every time it needed to display one. That might slow things down more than you like. But, no harm in giving it a try.
I'm on a broadband link; redownloading everything takes a lot less time than it does to write/read the cache to the card. Admittedly Chrome seems more efficient than Firefox in handling the cache, but now that I've rebooted and it's resumed caching I can definitely notice a slowdown.

Last edited by Changes; 09-28-2010 at 07:56 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What would happen if I where to cat /dev/mem > /dev/null Joey.Dale Linux - General 11 07-26-2009 12:46 PM
LXer: /dev/null And /dev/zero On Linux And Unix: What's The Difference? LXer Syndicated Linux News 0 04-29-2009 10:50 AM
Startx Permission problems on /dev/null and /dev/mem on freshly compiled 2.6.22.1 Eric_Cartman Linux - Kernel 2 09-09-2007 01:42 AM
What is meant by " file > /dev/null 2>&1 </dev/null " attockonian Linux - Newbie 5 06-30-2006 10:51 PM
mv c:\WINDOWS /dev/null; mount /dev/hda treehead LinuxQuestions.org Member Intro 5 10-19-2004 08:53 AM


All times are GMT -5. The time now is 10:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration