HTML5 application cache fallback not work in Firefox - html

I am using Firefox latest (11), and I've set IIS to serve *.appcache as text/cache-manifest, and I've double checked Firefox DID cache my files by looking into both "about:cache" "C:\Users\\AppData\Local\Mozilla\Firefox\Profiles\.\OfflineCache" (according to MDN), below is my demo.appcache file:
CACHE MANIFEST
../../js/jquery-1.7.1.js
offline.html
NETWORK:
# Chrome respects *
*
# Firefox respects following, refer: http://appcachefacts.info/
http://*
https://*
FALLBACK:
/ offline.html
CACHE:
foo.js
My steps are described below:
Clear all cache by Options -> Advanced -> "Offline Web Content and User Data" -> "Clear now".
Access my html page with <html manifest="demo.appcache">
I double Firefox did cache my items specified in demo.appcache above.
I switch my Firefox to "Work Offline" by Menu -> Web Developer -> Work Offline.
I access "Online.html" and I am expecting Firefox will render offline.html to me, however, it said "I cannot access the page because I am offline".
Chrome does everything correctly whereas it cannot be switched to "Offline mode", refer: Broken Offline Support
Opera can work offline, but it even does cache correctly, it didn't cache offline.html I specified in "Cache" module which obviously violates the standard.
I am struggling with this issue (step 5) for more than 3 days, any help would be highly appreciated!

I too have been working on this for the past couple days. Reading through your post I was about to post a reply when something hit me.
In Chrome I've been testing this using a Proxy switcher to toggle between my connection and bad proxy information to simulate loss of connection. Like you in Firefox I was using "Work Offline". In my case I was seeing a locally cached version of my "Online" page rather than the Offline fallback I expected.
In Firefox I went to Tools -> Options -> Network -> Settings and changed the Proxy information to see what would happen. It Worked!
So "Work Offline" either is not triggering the Fallback or possibly the local storage at all.
-Nathan

Related

HTML5 application cache issue

Chrome Version (type about:version into your omnibox): 24.0.1312.57 m
Operating System (Windows 7/8/Vista/XP, Mac, Linux, Android, iOS):Windows 7
Extensions (type Chrome:extensions into your omnibox):None/All disabled
I am having an issue using html5 application cache feature. I am loosing the contents of application and web sql as soon as close the window. If I am on the same everything works fine but when I close the window and type the url which should pick the file based on application cache does not work and everything is empty when I check through developer tools.
What could be the possible issue?
-sk
have you tried using the HTML5 localStorage. That is persistent even if you close the browser.
Also, make sure there aren't any headers stating "no-cache" etc.

Making HTML5 app available offline

I am working on an HTML app for a client. The entire app front end is done with 1 HTML file, 1 Javascript file, 1 CSS file (plus jquery) and a few images. There are a few php scripts sitting on the server, which are called using AJAX, but only if an internet connection is available. If no connection is available, then the site will use locally cached data (using localStorage).
To make the site available offline, I'm declaring the cache manifest in my HTML. My HTML looks like this:
<!DOCTYPE html>
<html manifest="cache.manifest.php" language="en">
...
</html>
The cache.manifest.php's output look like this:
CACHE MANIFEST
#VersionHash: 80b9345e6c39efbbe8431e394b014b4f
CACHE:
/css/ebot.css
/favicon.ico
/images/appicon.png
/images/list-arrow.png
/images/list-checkmark.png
/images/woman.png
/index.html
/js/jquery-1.8.3.min.js
/js/ebot.ls.js
NETWORK:
/emaillog.php
/getdata.php
/uploadlog.php
So far so good. Now, I access the site from a browser with the internet connection available. I get a little notification asking whether to allow the site to store information for offline use - I allow it. When I check in settings, I see that the site stores 316K of data - about right.
Now I turn off internet connection and attempt to access http://www.mysite.com/index.html - and get an error message saying "Internet connection not available" (or something to that extent) and the page is not displayed. This is happening in 3 browsers I tested on my dev machine (firefox, safari and chrome) as well as on the client's ipad (the app is eventually for consumption on an ipad).
What am I missing here? What am I doing wrong?
There could be many reasons for this.
Take a look at this articles:
http://www.fuckyeahtml5.com/2011/06/debugging-html5s-offline-web-apps
http://appcachefacts.info/
http://diveintohtml5.info/offline.html
https://developer.mozilla.org/en/docs/HTML/Using_the_application_cache
I guess that you didn't specify proper content type (MIME) for your manifest. It shoud be 'text/cache-manifest'.
Check events in console in Chrome. You should see something like this when appcache manifest is correct:
Creating Application Cache with manifest http://example.com/manifest.appcache
Application Cache Checking event
Application Cache Downloading event
Application Cache Progress event (YYY of XXX)
Application Cache Cached event
I would suggest to start from the simplest manifest to make sure that manifest is parsed. Try:
CACHE MANIFEST
NETWORK:
*
such manifest should cache only your start html page.

chrome in offline mode/open cached site?

I have a special kiosk-solution with chrome where I need chrome to upon application start, load the start-url from cache, not try to fetch it online.
The reason is that this is, like I said, a kiosk-mode presentation, is is a screen standing in the public that reboots every night, and if the reboot happens while the ISP has downtime on the internet connection, chrome will only show an error page.
If I can get it to load the cached version of the page though, instead of trying to fetch it online, then the last valid version of the page will show, and through some nifty ajax-workings of mine ;) it will automatically update after a while. If THAT update fails, the currently displayed version of the page will remain until a subsequent update succeeds.
See my problem?
In a browser like firefox I could do it by starting the browser in off-line mode and after page load switch it to online-mode. Only FF doesn't work for me in the particulat project, and Chrome doesn't seem to have an off-line mode?
You could use HTML5 Offline Web Applications to accomplish that. It's probably very easy to set up in your case, just add a file like the following to your app's directory:
CACHE MANIFEST
index.html
help.html
style/default.css
images/logo.png
images/backgound.png
NETWORK:
server.cgi
This manifest should contain all the files you'll need to display some useful information and later grab current content via AJAX. There's also a NETWORK section, where you have to specify things that should not be cached (ie the script that delivers your Updates via AJAX).
You can load the manifest file by adding a manifest attribute to your tag (cache-manifest is the name of the file above):
<html manifest="cache-manifest">
Make sure your server delivers the cache manifest with a MIME-type of
text/cache-manifest MIME
Type or copy-paste the below flag setting into the chrome address bar.
chrome://flags/#enable-offline-mode
scroll down to enable offline stale mode.
Restart your browser.
If an offline version of the page is available in the system cache it will load up when you are not connected.

HTML 5 offline storage cache manifest not working

I'm trying to get HTML5 offline storage working in a basic way. I read the information on DiveIntoHTML5 and it seems to make sense, but it just doesn't seem to be working for me. I wondered if someone could help me to debug this.
Basically I've set up a home page for the application, index.htm. So my application is on the web at http://www.mydomain.com/online/index.htm. Users will visit this page, where they'll ordinaraily do all of their stuff day-to-day. Visiting this URL will create a bunch of cached files so they can then visit http://www.mydomain.com/offline and view a working version of the application when they're offline.
The top few lines of code in the online homepage are:
<!DOCTYPE html>
<html manifest="cache.manifest">
<head>
...etc
I've generated a plain text file called 'cache.txt' and added the following content to it in Notepad:
CACHE MANIFEST
http://www.mydomain.com/offline/scripts/jquery-1.6.3.min.js
http://www.mydomain.com/offline/scripts/jquery-ui-1.8.16.custom.min.js
http://www.mydomain.com/offline/scripts/modernizr.min.js
http://www.mydomain.com/offline/scripts/json2.min.js
http://www.mydomain.com/offline/scripts/jquery.deserialize.js
http://www.mydomain.com/offline/scripts/jquery.cookie.js
http://www.mydomain.com/offline/scripts/main.js
http://www.mydomain.com/offline/css/main.css
http://www.mydomain.com/offline/css/structure-details.css
http://www.mydomain.com/offline/css/ui-lightness/jquery-ui-1.8.16.custom.css
http://www.mydomain.com/img/header.gif
http://www.mydomain.com/offline/img/bg.png
http://www.mydomain.com/offline/img/header_riser.gif
http://www.mydomain.com/offline/img/logo.png
http://www.mydomain.com/offline/img/offline.png
http://www.mydomain.com/offline/index.htm
I've then renamed this file to 'cache.manifest' and uploaded it to the root of the online application (at the same level as my home-page) so that it's accessible at http://www.mydomain.com/online/cache.manifest.
The hosting company have supposedly added the content type of 'text/cache-manifest' to all files with the extension of .manifest in IIS. I think this is working because when I view the file in Firefox at http://www.mydomain.com/online/cache.manifest Firebug tells me the content type is:
Content-Type cache-manifest
Or should this be returning 'text/cache-manifest'? Perhaps this is the problem?
When I view the offline storage folder on my system (C:\Users\Me\AppData\Local\Mozilla\Firefox\Profiles\b12u6xza.default there's nothing in there related to this domain at all.
Can anyone suggest what might be going wrong - as I'm a little stumped?
First of all, the specification have changed, you should now use .appcache as manifest extension.
Second, the mime type should be defined as you say text/cache-manifest. I'm not really related to IIS but seems like there's two ways to add this MIME type , either trough IIS administration UI or via web.config file
Also, I would recommend you testing this with Google Chrome, since its console show all the manifest parsing data and errors, including when the manifest MIME type is not being correctly recognized.
There are some issues you have to be care about:
Chrome (And I guess that all the browsers at last) only handles the cache file over secure requests. If your request is not secure, your cache won't be executed.
Mobile browsers (At least, the devices I could test), doesn't care about secure or unsecure requests. But I'd prefer to be ready for the politics change.
I was breaking my head trying to understand why in Android my file worked fine and in iOS it was failing, and the reason was that I was running my browser in incognito mode. iOS in incognito mode can't cache the page, and you get error.
If I find more issues, I'll write it down.
Regards.
I spend a lot of time on this (on my own problem), offline cache was not working. Did everything possible I could do, changed cache file name, added handler via htaccess, uploaded the file from local to live server, still the same problem. Finally got some help from this question myself.
I tested it in safari and it was working fine. The problem was Chrome browser. I also tried https as another user suggested, that also did not fix the problem. So may be there is an extension in chrome that is forbidding it from using the cache file. Before troubleshooting your problem first test it in standard browsers Safari, FireFox, IE, Opera. Do not test in non-standard browsers such as Brave, it did not work in it.
Officially from google
Which confirms deprecation in Ver 61 and onward. I am running 80.
Chrome support for applicationcache and manifest for offline html5 application.
Application Cache / Offline Application / Manifest Cache.
Aware that applicationcache has been deprecated, but whilst
replacement (service workers) not ratified have yet to replace in
legacy systems we have.
However, recent browser update seems to have disabled offline
functionality on HTTPS site. Our manifest files are now ignored and
chrome dinosaur displayed instead.
On checking back through browsers seems this is common from Chrome 61
and newer however it only seems to have manifested recently.
Chrome issue? or combination of Chrome and underlying OS? We have
android/windows both showing same problem from 61 onwards.
Note : HTML5 Cache is being deprecated
All browsers are going to drop this feature, I noticed they are not working in any of the latest browsers. This MDN Mozilla strongly advises against it and not to use it.
try to add these lines in httpd.conf ..this might help you
AddType text/cache-manifest .manifest
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/cache-manifest "access plus 0 seconds"
</IfModule>
You'd better test using chrome's console !(you can't see these in chrome's network)
My example(visit:www.mustrank.com/views/1.php ).
Look at chrome's console output below,manifest file "website.appcache" is created first,and then sources "1.html" and "main.css" are downloaded
[Creating Application Cache with manifest
www.mustrank.com/views/website.appcache 1.php:1
Application Cache Checking event 1.php:1
Application Cache Downloading event 1.php:1
Application Cache Progress event (0 of 2)
www.mustrank.com/views/1.html 1.php:1
Application Cache Progress event (1 of 2)
www.mustrank.com/css/main.css 1.php:1
Application Cache Progress event (2 of 2) 1.php:1
Application Cache Cached event ]

Disabling Chrome cache for website development

I am modifying a site's appearance (CSS modifications) but can't see the result on Chrome because of annoying persistent cache. I tried Shift+refresh but it doesn't work.
How can I disable the cache temporarily or refresh the page in some way that I could see the changes?
The Chrome DevTools can disable the cache.
Right-click and choose Inspect Element to open the DevTools. Or use one of the following keyboard shortcuts:
F12
Control+Shift+i
Command+Shift+i
Click Network in the toolbar to open the network pane.
Check the Disable cache checkbox at the top.
Keep in mind, as a tweet from #ChromiumDev stated, this setting is only active while the devtools are open.
Note that this will result in all resources being reloaded. Should you desire to disable the cache only for some resources, you can modify the HTTP header that your server sends alongside your files.
If you do not want to use the Disable cache checkbox, a long press on the refresh button with the DevTools open will show a menu with the options to Hard Reload or Empty Cache and Hard Reload which should have a similar effect. Read about the difference between the options to know which option to choose. The following shortcuts are available:
Command+Shift+R on Mac
Control+Shift+R on Windows or Linux
Clearing the cache is too annoying when you need to clear the cache 30 times an hour.. so I installed a Chrome Extension called Classic Cache Killer that clears the cache on every page load.
Chrome Store Link (free)
(Now without malware!)
Now my mock json, javascript, css, html and data refreshes every time on every page load.
I never have to worry if I need to clear my cache.
There are about 20 cache cleaners for Chrome I found, but this one seemed lightweight and zero effort. In an update, Cache Killer can now stay "always on".
Note: I do not know the plugin author in any way. I just found it useful.
Pull up the Chrome developer console by pressing F12 and then (with the console open):
Right click (or hold left click) on the reload button at the top of the browser and select "Empty Cache and Hard Reload."
This will go beyond "Hard Reload" to empty the cache entirely, ensuring that anything downloaded via javascript or etc. will also avoid using the cache. You don't have to mess with settings or anything, it's a quick 1-shot solution.
There are two more options to disable page caching in Chrome for good:
1. Deactivate Chrome Cache in the Registry
Open Registry (Start -> Command -> Regedit)
Search for: HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command
Change the part after ...chrom.exe" to this value: –disable-application-cache –media-cache-size=1 –disk-cache-size=1 — "%1"
Example: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -disable-application-cache –media-cache-size=1 –disk-cache-size=1 — "%1"
IMPORTANT:
there is a space and a hyphen after ...chrome.exe"
leave the path to chrome.exe as it is
If you copy the line, be sure to check, if the quotes are actual quotes.
2. Deactivate Chrome cache by changing the shortcut properties
Right-click on the Chrome icon and select "Properties" in the context menu.
Add following value to the path: –disk-cache-size=1
Example:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" –disk-cache-size=1
IMPORTANT:
there is a space and a hyphen after ...chrome.exe"
leave the path to chrome.exe as it is
If you do not wish to edit Chrome's settings you may use incognito mode for the same results.
F12 to open Chrome DevTools
F1 to open DevTools Settings
Check Disable cache (while DevTools is open) as shown below:
This is currently on the Preferences tab which is the default. You may need to scroll down. This checkbox has been moved at least a couple times since this question was asked. Last I checked, it was in the middle column at the bottom. If you have it open on a thinner screen and there are 2 columns under Preferences, it may be near the top right. Feel free to update this post if it changes or comment and I'll update the post.
In addition to the disable cache option (which you get to via a button in the lower right corner of the developer tools window -- Tools | Developer Tools, or Ctrl + Shift + I), on the network pane of the developer tools you can now right click and choose "Clear Cache" from the popup menu.
Instead of hitting "F5"
Just hit:
"Ctrl + F5"
In the Canary Channel (and maybe the dev and stable channel will follow along) this is to be found as the second option overall on the left hand-side under the "General" section.
In addition to that, there is always the option to switch into Incognito Mode via Ctrl + Shift + N. Even though that unfortunately also ends your session.
To be clear, the disable cache checkbox in Chrome (v17 here, but since v15 I believe) is not in the main settings UI. It is in the developer tools settings UI.
From the browser window's wrench icon menu (prefs menu) choose Tools → Developer Tools
In the developer tools UI that appears, click the gear icon at bottom right.
Check the 'Disable cache' checkbox in the Network section.
Using Ctrl+Shift+R to refresh was nice but didn't get everything I needed.
still some things wouldn't refresh, such as data stored in js and css.
found a solution: a toolbar of google for chrome web developers. After you install the toolbar select options and "reset page".
Disable cache in chrome only works when you have dev tools open
Until the bug is fixed you could use Clear Cache Chrome plugin and you can also set a keyboard shortcut for it.
After installing it, right click and go to options:
Check Automatically reload active tab after clearing data:
Select Everything for Time Period:
And then you can go to Menu => Tools => Extensions:
Click on keyboard shortcuts at the bottom:
And set your keyboard shortcut, for example Ctrl + Shift +R:
Actually if you don't mind using the bandwidth it is more secure for multiple reasons to disable caching and advised by many security sites.
Chromium shouldn't be arrogant enough to make decisions and enforce settings on users.
You can disable the cache on UNIX with --disk-cache-dir=/dev/null.
As this is unexpected crashes may happen but if they do then that will clearly point to a more severe bug which should be fixed in any case.
This might help someone.
I have rigged my Nginx for crazy caching. Thus, disabling cache in network tools and explicitly clearing cache don't work.
A very simple yet boring workaround is, I just open a new Incognito Tab. Surprisingly it works, all the time!
A hard refresh in incognito mode does the trick anytime I wish to reload in the same mode.
When this question was asked, Chrome didn't support the Disable Cache feature. But now, you can find the "Disable Cache" feature in Network Tab in Chrome Dev Tools.
Network Tab with Cache Disabled
You can see that all the resources (I have filtered JS resources) have been fetched from network and not loaded from disk/memory cache.
Disable Cache not selected
You can see that when I refreshed the page but didn't select the "Disable Cache" feature, almost all the resources were loaded from Cache.
This works fine for local web development but there are certain limitations that I'd like to highlight. You can stop reading here if the solution discussed so far meets your use case.
Limitations
You have to keep the DevTools Open and Disable Cache Selected
When you disable the cache, it is disabled for all the resources in that tab. It makes things slow and is inefficient if you want to disable cache for only 1-2 resources
Using Requestly Chrome Extension to disable Cache for particular resources (JS/CSS/Images, etc)
Recently, I stumbled upon https://dev.to/requestlyio/disable-caching-of-particular-js-css-file-2k82 which helped me understand how you can disable cache for specific resources.
The trick here is to add a query parameter to your resource with random value every time the request is made. Using Requestly Query Param Rule, you can add a param like this
URL Contains mywebsite.com/myresource.js
Add param cb rq_rand(4)
rq_rand(4) is replaced by 4 digits random number when a request is made.
Requestly Query Parameter Rule to add random parameter
After adding the rule, JS/CSS files are not cached
Here you can see that "Disable Cache" is not selected and still the resources are not loaded from Cache because of a random parameter (cb - Read it as Cache buster) in the URL.
The good thing is you don't need to keep your dev tools open for having this behavior
You can keep this permanently ON and your browsing experience won't be affected too.
How to get the Rule
Here is the link using which you can browse & download the rule if you have Requestly installed - https://app.requestly.io/rules/#sharedList/1600501411585-disable-cache-stackoverflow
Disclaimer: I built Requestly but I think this could be helpful to a lot of web developers and hence sharing here.
How about a bookmarklet which changes the page name to prevent the page from cacheing. In Chrome you would create a new bookmark and then paste the code into the URL. Click the bookmark and the page will reload with timestamp to thwart the cache.
javascript:(function(){var idx = location.href.indexOf('?');var d = new Date();var str = location.href.substr(0,idx) + '?version=' + d.getTime();location.href=str; void 0;})();
I just got caught out but not necessarily due to Chrome.
I am using jQuery to make AJAX requests. I had the cache attribute set to true in the request:
$.ajax({
type: 'GET',
cache: true,
....
Setting this to false fixed my problem but this is not ideal.
I have no idea where this data is saved but I do know that chrome never hit the server for a request.
There is a better and quicker way now (Chrome version 59.x.x.):
Right-click onto the reload-icon (left of the url-field) and you get a drop-down menu, select the third option: 'empty Cache and Hard reload'.
This option is only available when the developer tools are open.
(Notice the difference to option 2: 'Hard reload' -cmd-shift-R). No cache emptying here!
There is a chrome extension available in the chrome web store named Clear Cache.
I use it every day and its a very useful tool I think. You can use it as a reload button and can clear the cache and if you like also cookies, locale storage, form data etc. Also you can define on which domain this happens. So can clear all this shit with only the reload button which you anyway have to press - on your chosen domains.
Very very nice!
You also can define a Keyboard Shortcut for this in the options!
Also another way is to start your chrome window in incognito-mode.
Here the cache also should be completely disabled.
One more option for disabling the cache is provided by my 3rd Chrome extension Page Size Inspector that disables the cache exactly the same way as Devtools does.
In addition, the extension quickly reports page size, cache usage, network requests and load time of a web page in a convenient way. Plus its open source at Github.
Not sure what you are using, but if you are using ASP.Net you can do the following which works like a charm:
<link href="#Url.Content("~/Content/Site.css")?time=#DateTime.Now" rel="stylesheet" />
Basically it will automatically append the Date and Time to the end of the file each time it is ran, meaning since the file name is technically different, you will never have to worry about it getting cached again.
I had the same problem, I tried :
Control Shift R,
Disable cache in F12
Control F5.
Then I discovered that using a .appcache manifest for a non https site is deprecated.
I removed my site.appcache file and its reference in the html tag and now I'm seeing the latest version of each page!
If you're using ServiceWorkers (e.g.: for Progressive web apps), you'll likely need to check "Update on reload" under Application > Service Workers in dev tools too.
Since version 50 (if I remember correctly), the "Disable cache" option was removed from the Devtool Settings. Go to the "Network" tab and there's the "Disable cache" option.
The problem with "annoying" cache in general layes in the framework :). Let's see details.
Most of frameworks uses in .htaccess (os equivalnent) derective redirecting all requests to frameworks "index",
BUT it the same time EXCLUDE files and directories requested by application directly.
(f.e. as for .htaccess typical directives are:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
)
Thus ALL .js, .css files as graphics ones are not handled by frameworks "index".
And those files are generally most often changed during development.
That's why the cache control derective should not be placed in frameworks "index".
It should be palced in .htaccess.
F.e. for development process use:
Header set Cache-Control "no-store, no-cache, must-revalidate"
Header set Pragma "no-cache"
(Or for consecutive working versions, use "Etag" directive - check more in HTTP reference. Notice, that ETag is not intended for development.
In .htaccess there is no direct way to generate random number (or fast changing sequence like date UTC) to use in ETag, because - as I mentioned before - this is not what this is provided for).
Hope it helps and saves time.
Hey if your site is using PHP then place following little PHP snippet at the beginning of your html page :
//dev versioning - stop caching
$rand = rand(1, 99999999);
Now everywhere you load resources like CSS- or JS- files in a script or link element you append your generated random value to the request URL after appending '?' to the URI via PHP:
echo $rand;
Thats it! There will be no browser that caches you site anymore - regardless which kind.
Of course remove your code before publishing or simply set $rand to an empty string to allow caching again.
I have used the other options described above but I find that the best is to add the following parameter to the startup of chrome.exe.
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disk-cache-size=1
-media-cache=1
I find not disabling media cache is a good idea but it is here for completeness sake.
In actuality I want an option to completely disable the cache, to use the memory for IO instead of my disk (which would make load time 10x faster too!) but I don't think chrome or any browser for that matter has that option yet.
How can I disable the cache temporarily or refresh the page in some way that I could see the changes?
It's unclear which "cache" you're referring to. There are several different methods a browser can cache content persistently. Web Storage being one of them, Cache-Control being another.
Some browsers also have a Cache, used in conjunction with Service Workers, to create Progressive Web Apps (PWAs) providing offline support.
To clear the cache for a PWA
self.caches.keys().then(keys => { keys.forEach(key => console.log(key)) })
to list the names of the cache keys, then run:
self.caches.delete('my-site-cache')
to delete a cache key by name (i.e., my-site-cache). Then refresh the page.
If you see any worker-related errors in the console after refreshing, you may also need to unregister the registered workers:
navigator.serviceWorker.getRegistrations()
.then(registrations => {
registrations.forEach(registration => {
registration.unregister()
})
})
Chrome's Cache killer is by far the best option. Since the store URL to install cache killer is down, you can download the CRX file here:
https://www.crx4chrome.com/extensions/jpfbieopdmepaolggioebjmedmclkbap/
once the extension file is downloaded, open Chrome -> more tools -> extensions, then drag the CRX file from the File Explorer or your Desktop (depending the location where you downloaded the file) into the chrome window to install the extension.