spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

Chrome clear cache extension - when run cache is not cleared immediately


The chrome.browsingData.removeCache method is asynchronous (i.e. non-blocking). This means that if you immediately reload the tab after calling removeCache, the removeCache call is still being processed and the cache may not be empty yet.

To get the desired behavior, wait until the cache is cleared, by putting the reload call in the callback to removeCache. And by the way, you don't need to call chrome.tabs.getSelected to get the current tab, just use the tab parameter that is passed in to the chrome.browserAction.onClicked event.

function clearMe(tab) {
    var ms = (30 * 60) * 1000; // 30 minutes
    var time = Date.now() - ms;
    chrome.browsingData.removeCache({"since":
time}, function() {
        chrome.tabs.reload(tab.id);
    });
}

chrome.browserAction.onClicked.addListener(clearMe);

Categories : Javascript

Related to : Chrome clear cache extension - when run cache is not cleared immediately
clear cache of Picasso in android?
Try this Picasso.with(context).cache.clear(); For Further reference see this. Invalidate cache in Picasso Mark as up, if it works for you. :)

Categories : Android
How to clear the cache in a Titanium WebView?
I am not quite sure whether you can clear the cache in titanium easily but maybe you should disable it completely. Have a look at setCacheMode(cacheMode) in the documentation. This method allows you to set the caching mode to one of several predefined modes which are described in the documentation. One of them is Titanium.UI.Android.WEBVIEW_LOAD_NO_CACHE which is preventing the webView from cachin

Categories : Android
How to clear the cache after user log out from website in codeigniter
After destroying the session use $this->cache->clean(); for details check this out

Categories : Codeigniter
Want a cache filter attribute that keep data in cache till user logged in
HttpResponse.RemoveOutputCacheItem should work unless you are using querystring or additional route parameters. You can always use VaryByCustomto make sure cache holds only for a duration of a session but you have to make sure you clear the session once user is logged out. Global.asax.cs: public class MvcApplication : HttpApplication { ... public override string GetVaryByCustomString(HttpC

Categories : C#
Edited Chrome Extension - chrome thinks it is malware
Turns out that I had to make a copy of the extension to an external directory, then delete the existing one. From there, I followed the instructions here: http://superuser.com/questions/247651/how-does-one-install-an-extension-for-chrome-browser-from-the-local-file-system. Text for the lazy: Navigate to chrome://extensions. Expand the developer dropdown menu and click "Load Unpacked E

Categories : CSS
Recently Add
How to add items to sharepoint list from a html document?
Copying App Package Folder To Isolated Storage For Windows Store App
javascript save file from (sinatra's) streaming response
Use routeParams to create templateUrl in AngularJS
resize image using javascript
How to add and remove div's (input)
Onsen UI sliding menu
BxSlider is working but there is a blank space inside div
on button click delete from datatable and also from array
Jquery changing table th tag is not working properly
Get file height width before uploading using Javascript / Asp.net
Break out of Bootstrap modal dialog if unauthenticated
Listener for click on ANY element and read particular HTML-5 custom attribute when present?
What is the best way to use this in prototype method
Get Latitue and Longitude of the center in google map when draged
Jquery multidimensional Json parse
Not able to format date
How to force y position of one branch in d3 sankey plugin?
radio button doesn't come up from JS file
Calling PHP webservice method from Javascript/jQuery
Responsive menu - parent menu with link
'click' event firing multiple times, no solutions working
How to create Cordova Blackberry (Hybrid) application
Javascript date picker multiple select
How to do the marker management in google map
JQuery/Ajax Unexpected Identifier error
AngularJS Promise error catching
Populate form from child object
Jquery popup with scrollbar and column alignment
OpenLayers3 control panel
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.