librelist archives

« back to archive

Fix for cache management in recent XULrunners

Fix for cache management in recent XULrunners

From:
Edward Trumbo
Date:
2015-01-22 @ 15:51
Last month Owen Mays asked about an error when trying to clear_cache in 
Conkeror. I've just joined the mailing list to post what I've discovered.

I've noticed the same problem in XULrunner versions greater than 31. This 
is because Mozilla rewrote their cache management starting with version 
32, as noted in this blog post:

http://www.janbambas.cz/http-cache-v1-api-disabled/

and in this Bugzilla post:

https://bugzilla.mozilla.org/show_bug.cgi?id=913806

The comments in Bugzilla pointed me in the right direction. about:config 
has two parameters that allow us to select new or old-style cache 
management:

browser.cache.use_new_backend
browser.cache.use_new_backend_temp

I got lucky with my first attempt, by toggling the _temp entry to "false".
As of now, I can clear my Conkeror cache when running under XULrunner 
35.0.

Obviously, this is a hackish band-aid and may not work in later XULs. 
Given my limited testing so far, it may introduce more trouble than it 
solves. For now, all I can say is it seems to work with no apparent 
problems. Ultimately, Conkeror's cache.js would have to be patched to 
accommodate both cache schemes, but that's a task I'd have to leave to 
someone with much more Javascript skill than me.

-- 
Edward Trumbo

"In Emacs Veritas."