Hi dorando, Morat, Zoolcar
Long time no see and I really need you guys help again
I know that a extension called "CacheViewer" can delete specific Firefox cache:
https://addons.mozilla.org/en-us/firefo ... cheviewer/ (Open CacheViewer, select cache entry that you want to clear -> Right Click -> Delete)
How can I do that with a Keyconfig command ? Example I want to delete "http://example.com/javascript/time.js" from FIrefox cache.
I really want to do that because I'm using BetterCache addons, it speed up my FIrefox (even some hidden connection it still can force it get cached) but sometimes I have to clear some cache entries like ( "http://example.com/javascript/time.js" , "http://example.com/javascript/work.js"...) but it is not really fast using CacheViewer, I think if I can create a Keyconfig shortcut and clear them then it will be faster.
Many thank!
I read CacheViewer source code but don't know how to port it to Keyconfig and make it only delete cache URL like cache.delete("http://example.com/javascript/time.js"); or something like that.
Code: Select all
_delSelEntry: function CV__delSelEntry(){
if (this._delEntryList.length == 0)
{
this._updateUI();
return
}
entry = this._delEntryList.shift();
var key = this._rdf.getLiteralProperty(entry, this._rdf.NS_CACHEVIEWER+"key");
var client = this._rdf.getLiteralProperty(entry, this._rdf.NS_CACHEVIEWER+"clnt");
var stream = this._rdf.getIntProperty(entry, this._rdf.NS_CACHEVIEWER+"strm");
var self = this;
this._asyncOpenCacheEntry(key, client, stream,{
onCacheEntryAvailable:function(descriptor, accessGranted, status) {
if(status != Components.results.NS_OK)
{
self._delSelEntry();
return;
}
try {
descriptor.doom();
} catch(e) {
dump(e+"\n");
}
descriptor.close();
// moved from _updateUI
self._rdf.removeResource(entry, self._rdf.getContainer(self._rdf.RDF_ITEM_ROOT));
if (self._tree.ref == self._rdf.RDF_ITEM_SEARCH)
self._rdf.removeResource(entry, self._rdf.getContainer(self._rdf.RDF_ITEM_SEARCH));
self._DBConn.executeSimpleSQL("DELETE FROM cacheentries WHERE id = "+entry.Value);
self._delSelEntry();
}
}
);
},
deleteCache: function CV_deleteCache() {
if (this._isLoading) return;
this._delEntryList = [];
var rangeCount = this._tree.view.selection.getRangeCount();
for (var i=0; i<rangeCount; ++i) {
var rangeMin = {};
var rangeMax = {};
this._tree.view.selection.getRangeAt(i, rangeMin, rangeMax);
for (var j=rangeMin.value; j<=rangeMax.value; ++j) {
this._delEntryList.push(this._tree.view.getResourceAtIndex(j));
}
}
if (this._delEntryList.length>0)
this._delSelEntry();
},