http://www.mozilla.org/support/firefox/tips.html#…
Specify where to store the cache
To specify in which folder the cache is stored, add the following code to your user.js file:
// Path to Cache folder:
user_pref("browser.cache.disk.parent_directory","C:\\Path To Cache");
Remember to use two backslashes for the path separators if you're using Windows, e.g. C:\\Path\\Path To Cache instead of C:\Path\Path To Cache.
Specify the memory cache usage
Normally, Firefox determines the memory cache usage dynamically based on the amount of available memory. To specify a specific amount of memory cache, add the following code to your user.js file:
// Specify the amount of memory cache:
// -1 = determine dynamically (default), 0 = none, n = memory capacity in kilobytes
user_pref("browser.cache.memory.capacity", 4096);
To disable the memory cache completely, add the following code:
// Disable memory cache:
user_pref("browser.cache.memory.enable", false);