Can't seem to set the cache directory as of 30042001 build

VERIFIED FIXED in mozilla0.9.5

Status

()

P2
normal
VERIFIED FIXED
18 years ago
17 years ago

People

(Reporter: conceptrat, Assigned: gordon)

Tracking

Trunk
mozilla0.9.5
x86
Windows 98
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: PDT+ [verified on branch])

Attachments

(2 attachments)

(Reporter)

Description

18 years ago
As of the 30042001 build the cache directory doesn't seem to be able to be set
via the prefs.js entry:

user_pref("browser.cache.directory", "");

It seems to just default to the NewCache directory in the profile directory.

Is this to be a feature.  Would rather be able to specify where the cache
resides.  Like say the temp directory.
over to cache
Assignee: dveditz → gordon
Component: Preferences: Backend → Networking: Cache
QA Contact: sairuh → tever
(Reporter)

Comment 2

18 years ago
Found the reason.  I don't know if this is how it's supposed to work, but ...

If you don't set user_pref("browser.enable.cache", true); then the browser uses
the directory "NewCache" under the profile your using.  If you set
user_pref("browser.enable.cache", true); then the cache goes into the directory
specified in user_pref("browser.cache.directory", ""); and in my case I must
specify "\" as "\\".

(Reporter)

Comment 3

18 years ago
Oooops sorry just realised that the user_pref("browser.cache.directory", "");
 is for the older cache system.  For the new cache system I mean't to say
user_pref("browser.newcache.directory", "");
(Assignee)

Comment 4

18 years ago
This all seems very confusing.  I'll try and straighten this up for 0.9.1.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → mozilla0.9.1
(Assignee)

Comment 5

18 years ago
One of the things we need to clean up is to stop using "NewCache" as a directory 
name, and go back to "Cache".
(Reporter)

Comment 6

18 years ago
When that's going to happen could you make sure to check the database in the
cache directory just in case someone is using the older caching/mozilla version.
 If so just delete the cache directory contents and start again.  I think this
sounds right.  Trying to help.

Comment 7

18 years ago
related to the cleanup of the profiles.
Keywords: nsbeta1+
(Assignee)

Updated

18 years ago
Priority: -- → P3

Comment 8

18 years ago
moving to 0.9.2 per PDT triage
Target Milestone: mozilla0.9.1 → mozilla0.9.2
(Reporter)

Comment 9

17 years ago
I know this isn't  big deal for most who understand what's going on, but I can't
imagine that too much of a problem to fix it.
It's a real pain if by default the new cache goes to NewCache in your profile
directory and that the Preferences doesn't correctly add the option:
  user_pref("browser.newcache.directory", "...");
and instead adds
  user_pref("browser.cache.directory", "...");
to set the directory that your cache goes to.
Could this be any simpler?

Anyway fix for now for new builds for the moment is the following:

In your prefs.js file look for:
  browser.cache.enable

Should be:
  user_pref("browser.enable.cache", true);

Now in your prefs.js file look for, but don't expect to find it:
  browser.newcache.directory

Should be:
  user_pref("browser.newcache.directory", "...");
If it's not in there, put it in and replace the ... with the directory that you
want the cache files to go in.

Example, from my computer for build 2001053104:
  user_pref("browser.newcache.directory",
"d:\\temp\\Mozilla\\Julz\\heial9p5.slt\\Cache");
(Assignee)

Comment 10

17 years ago
I think the bug is that we're still using browser.newcache.directory.
(Reporter)

Comment 11

17 years ago
Yup definitely.  Although I'm not sure if this gets fixed, to use the
"browser.cache.directory" prefs.js setting, what happens if the new builds of
the browser find the old cache database and files in the directory set in
"browser.cache.directory".  Hopefully this will just be a matter of check cache
file type if it's old style then delete files in this directory and start
creating new cache files.
(Assignee)

Comment 12

17 years ago
*** Bug 85348 has been marked as a duplicate of this bug. ***

Comment 13

17 years ago
Is this related to bug 46490 ?
(Assignee)

Comment 14

17 years ago
Only sort of. That bug is related to the UI, this bug is for the cache service
to read the preference properly.

Comment 15

17 years ago
Lets try these on the trunk and if they do well there we can try bringing them 
back in the 0.9.2 branch.
Keywords: nsBranch
Target Milestone: mozilla0.9.2 → mozilla0.9.3
(Assignee)

Updated

17 years ago
Priority: P3 → P2

Comment 16

17 years ago
*** Bug 87978 has been marked as a duplicate of this bug. ***

Updated

17 years ago
Target Milestone: mozilla0.9.3 → mozilla1.0

Comment 17

17 years ago
*** Bug 89664 has been marked as a duplicate of this bug. ***

Comment 18

17 years ago
Things have gotten broken in the last few weeks, now even
browser.newcache.directory is being ignored and the default cache directory is
being used in the profile directory.  win32 2001071004 build

Comment 19

17 years ago
fyi:

user_pref("browser.cache.directory", "D:\\cache\\Mozilla\\");
...
user_pref("browser.newcache.directory", "D:\\cache\\Mozilla\\");

Comment 20

17 years ago
I also see this problem.  Even after following the steps earlier in the bug, I
cannot make the cache go anywhere but myprofiledir/Cache/  (nightly 2001071704,
win32)
(Reporter)

Comment 21

17 years ago
Okay "browser.newcache.directory" is working again under Win32 Build 2001072403,
see my comments further up.  I'm just getting the latest trunk win32 to see if
that's working again.
By the way Build 2001072403 seems quite stable, hopefully the latest trunk will
be too.

Comment 22

17 years ago
nope 2001072808 still defaults to profile directory.
(Assignee)

Comment 23

17 years ago
The trunk is no longer using browser.newcache.directory, but rather
"browser.cache.disk.directory".  This preference indicates the parent directory
that the cache directory will be create in.  We no longer create a directory
named "NewCache", but just simply "Cache".

Comment 24

17 years ago
Are we going for a prefs.js cache entry record for complete obfuscation?

user_pref("browser.cache.directory", "D:\\cache\\Mozilla\\");
user_pref("browser.cache.disk.directory", "D:\\cache\\Mozilla\\");
user_pref("browser.newcache.directory", "D:\\cache\\Mozilla\\");



Comment 25

17 years ago
OK, the new pref works, but it now creates a "Cache" directory under the
specified path.  If the pref specifies a path, why add another dir level?
(Assignee)

Comment 26

17 years ago
Excellent questions.

We are adding a new preference and new level for the cache directory to avoid
drastic consequences of the simple misunderstanding between "where I want my
cache directory to go" and "what I want my cache directory to be".

Someday we would like to reintroduce UI for setting the location of the cache
directory, and then even more users will be subject to this confusion (not just
those that are comfortable editing their prefs.js files).

By interpreting the preference as the parent of the cache directory, the
consequences of misunderstanding are relatively minor: if the user mistakenly
thinks the pref represents the path of the cache directory, the result is a
cache directory is created one level deeper than expected.

However, interpreting the preference as the path of the cache directory rather
than the parent has much more severe results: if the user mistakenly thinks the
pref represents the parent directory of the cache "I want the cache in my home
directory/system folder/etc.", the disk cache will spew cache files into that
directory, and may even attempt to delete non-cache files as well (clear cache).

That's why it is important to migrate to a new preference and a new interpretation.

Comment 27

17 years ago
perhaps "browser.cache.disk.parent_directory" would be a less confusing name?
(Assignee)

Comment 28

17 years ago
Yup.  I'd be hip to that.

Comment 29

17 years ago
Can someone please summarize the situation? What is the current prefs.js syntax
to set the cache location, and does it work on any or all platforms?

Comment 30

17 years ago
In order for the cache to be in a nonstandard place you need to add the
following two lines to your prefs.js file (WinME):

user_pref("browser.enable.cache", true);
user_pref("browser.cache.disk.directory", "C:\\temp\\mozillacache");

Adjust the path to your needs. Mozilla will create a subdirectory named "Cache"
below the directory you specify.

Methinks I had the problem of being unable to set the cache directory under
Linux. I have no access to a Linux box capable of running mozilla right now. Can
somebody comment on this?

Comment 31

17 years ago
Thanks for the update. This doesn't seem to work on Mac OS X. I tried

user_pref("browser.enable.cache", true);
user_pref("browser.cache.disk.directory", "HD Name:pathtofolder");

Also tried UNIX-style
user_pref("browser.enable.cache", true);
user_pref("browser.cache.disk.directory", "/pathtofolder");

Both times the browser continued to use the Cache folder in my profile folder

Updated

17 years ago
Blocks: 99142

Comment 32

17 years ago
Gordon/Gagan - This is marked TM1.0. Suggest we nsbranch- it for this round.

Updated

17 years ago
Keywords: nsbranch → nsbranch+
(Assignee)

Updated

17 years ago
Target Milestone: mozilla1.0 → mozilla0.9.4

Comment 33

17 years ago
0.9.4 is out the door.
Target Milestone: mozilla0.9.4 → mozilla0.9.5
(Assignee)

Comment 34

17 years ago
Created attachment 49799 [details] [diff] [review]
patch to change preference name to Darin's suggestion.  This will make the behavior easier to understand.

Comment 35

17 years ago
sr=darin
(Assignee)

Comment 36

17 years ago
Created attachment 49803 [details] [diff] [review]
Darin's original suggestion used an underscore rather than mixed case.  I like that better.

Comment 37

17 years ago
Comment on attachment 49803 [details] [diff] [review]
Darin's original suggestion used an underscore rather than mixed case.  I like that better.

sr=darin
Attachment #49803 - Flags: superreview+

Comment 38

17 years ago
Comment on attachment 49803 [details] [diff] [review]
Darin's original suggestion used an underscore rather than mixed case.  I like that better.

seems clearer to me to say parent_directory. r=gagan
Attachment #49803 - Flags: review+

Comment 39

17 years ago
check it in today -PDT+
Whiteboard: PDT+
(Assignee)

Comment 40

17 years ago
Change checked into trunk and branch.

Mozilla on the Macintosh does not allow you to enter text in preference files to
specify file/directory locations.  nsIFile objects are stored as aliases on the
Mac, so any  code that reads in file location preferences would simply get
confused by a simple pathname.  To enable the feature of specifying the cache
directory on the Mac, we need to have UI - which is covered by another bug (bug
46490).

I'm marking this bug fixed.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 41

17 years ago
verified on branch - 

these work:
user_pref("browser.cache.disk.enable", true);
user_pref("browser.cache.disk.capacity", 40000);
user_pref("browser.cache.disk.parent_directory", "d:\\tempcache\\");  

similar for unix except slashes reversed.

Win NT4 2001-09-24-05-0.9.4
Linux rh6 2001-09-24-04-0.9.4
Keywords: vtrunk
Whiteboard: PDT+ → PDT+ [verified on branch]

Comment 42

17 years ago
VERIFIED on Linux

However, the pref

user_pref("browser.cache.disk.enable", true);

is no longer necessary. Specifying

user_pref("browser.cache.disk.capacity", 40000);
user_pref("browser.cache.disk.parent_directory", "/tmp/mozcache");

is sufficient.

BTW, I have posted a patch for bug 46490 to add the UI for this feature into the
prefs panel. Go check it out and give it a review!

Comment 43

17 years ago
verified on Win98, therefore marking VERIFIED.

I used the prefs
user_pref("browser.cache.disk.capacity", 40000);
user_pref("browser.cache.disk.parent_directory", "d:\\tempcache\\");  

the following is no longer necessary

user_pref("browser.cache.disk.enable", true);

Can someone try to verify this on a Mac? That would be very helpful for me since
I am trying to come up with a GUI for this in bug 46490. I have it working on
Linux and Windows, Mac is more difficult, especially since I do not have one to
test this on. Does this work at all on a Mac?
Status: RESOLVED → VERIFIED

Comment 44

17 years ago
*** Bug 106099 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.