3

Is there a plugin or method for performing selective caching in firefox? I can disable caching entirely, but I'd like to be able to still cache some large javascript libraries (extjs) which take several seconds to load.

Community
  • 1
  • 1
eaubin
  • 658
  • 9
  • 14

3 Answers3

0

If you are doing this in development locally, you could load the js files locally instead of over the network.

Mike Buckbee
  • 6,793
  • 2
  • 33
  • 36
0

From your post, I can't imagine what's the context or use case scenario. If you just need it for development purposes you can load the files you want to cache in an standard window. Then open a private window for your testing web. Each time you want to refresh the cache, close and reopen the private window.

Anything available on the cache will be available to the private window, but once you close the private window, anything else will be removed.

You can create an auxiliary file cache_me.html and open it in the standard -non-private- window:

<head>
  <script src="I_want_to_cache_this.js" />
 ..
</head>
earizon
  • 2,099
  • 19
  • 29
  • Here's a use case: You always browse Facebook and you often do some research and visit hundreds of sites yet you only visit each of them once and never return. In order to prevent unneeded disk writes, you want to allow only Facebook to cache stuff. Because caching from example.com which you will never visit again is wasteful. – Hello World Jul 06 '14 at 09:53
  • In such case I think private browsing can work. I know for sure that no cache will be used after closing. I'm not sure if it will be used while the private windows is open, but maybe it's still useful to write in cache to avoid network connections (that are more expensive in terms of battery). – earizon Jul 06 '14 at 10:40
  • Yes but private browsing kills everything, including history, etc. – Hello World Jul 06 '14 at 14:11
  • Another use case: You want to avoid tracking. Some sites use etags for tracking. So you disable caching globally, except for sites you trust and/or sites you know would track you via other means anyway (Facebook tracks you by your username for example) – Hello World Aug 09 '14 at 06:45
0

There's no plugin which would provide such features.

"Selective Caching" can be implemented on the server-side.

Check this link

Squid Cache can solve your problem.

Also, you can write the following:

<script type="text/javascript" src="scripts/ext.js"></script>
<script type="text/javascript" src="scripts/custom_script.js?<?php echo time(); ?>"></script>

The second JS file won't be cached. Technically, the browser will cache a different version of the file, so you'll have the latest version every time you refresh the page. The ExtJS file will be cached.

In case you want to use HTML5, this solution will let you choose which files should be cached and which files should be requested from the server: http://gregsramblings.com/2012/05/28/html5-application-cache-how-to/

Community
  • 1
  • 1
Wissam El-Kik
  • 2,469
  • 1
  • 17
  • 21