6

When using "Load unpacked extension". I have to pass a query string (eg ?v=\d+) to scripts included in the background page to break the cache.

Is there any way to disable this caching behavior?

6
  • Why do you use Load unpacked extension? Can't you just click on "Reload"? Commented Jul 27, 2012 at 14:26
  • 2
    I use reload, but for some reason it still keeps the cache on the extension resources. Commented Jul 28, 2012 at 17:01
  • That bug sounds familiar. I've experienced it in the past, but not having trouble any more (I've created an extension for quicker extension development, see this post). Which Chrome version are you using? Commented Jul 28, 2012 at 20:34
  • 2
    I thought that I experienced the bug again. After some headaches, I discovered that I copied the wrong files. Make sure that you check that the relevant files are correctly SAVED to the relevant directory. Commented Jul 30, 2012 at 23:12
  • The dev tools have an option to disable the cache, i don't know if this cache includes extensions' files, but you could try it. Nonetheless, like the previous comment says, be sure to edit and save the relevant files :D (I fell for this many times) Commented Oct 19, 2012 at 1:54

1 Answer 1

0

Maybe try keeping a file with an update number and when your users open the extension it detects the new update and clears the cache? You can add cache permission in the extension manifest like below:

"permissions": [ "browsingData", ], 

Then in your extension clear the cache like so:

var callback = function () { // Do something clever here once data has been removed. }; var millisecondsPerWeek = 1000 * 60 * 60 * 24 * 7; var oneWeekAgo = (new Date()).getTime() - millisecondsPerWeek; chrome.browsingData.remove({ "since": oneWeekAgo }, { "appcache": true, "cache": true, "cookies": true, "downloads": true, "fileSystems": true, "formData": true, "history": true, "indexedDB": true, "localStorage": true, "pluginData": true, "passwords": true, "webSQL": true }, callback); 
Sign up to request clarification or add additional context in comments.

1 Comment

Just remember to disable this before you publish it, it would be terrible behavior.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.