Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My users are all on NFS home directories and with hundreds of users all using firefox it generates a bit of traffic reading/writing to the disk cache. As a result, I'd like to move the default firefox disk cache over to a local file system just to reduce extraneous NFS traffic and lighten the load on my NFS server too.

I know I can set system wide default preferences in a file called my_firefox_path/defaults/pref/all.js of the following form: pref("browser.cache.disk.parent_directory", string)

For testing I had it set to the following: pref("browser.cache.disk.parent_directory", "/tmp/firefox/");

Unfortunately that doesn't work well as there are multiple users on each system. Is there a way to include a user and a profile in that preference file so that I can tweak this system wide and it will apply to all my users? Something like: pref("browser.cache.disk.parent_directory", "/tmp/firefox/$USER/$PROFILE");

share|improve this question
    
You may be able to use getenv() to retrieve environment variables. For instance: getenv("USER") for the username; not sure how you could get the profile path though. Extensions can easily retrieve the profile path, but I expect that making the extension API available outside of an extension would be a challenge. –  cyberx86 Aug 17 '11 at 8:18
    
Not able to use getenv() or grab the profile path by running this in the .js file: Components.classes["@mozilla.org/file/directory_service;1"].getService( Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile).path –  Andrew Case Aug 18 '11 at 3:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.