Prefer online cache metric issue

When setting the preference to online, I expect the browser to request a page each time the browser is updated, but that is not the case.

Here is my manifest:

CACHE MANIFEST SETTINGS: prefer-online NETWORK: * 

However, when I update the browser, it only requests the manifest for the server. It only requests the page when updating the manifest ...

And there are no headings on the page (expire or maximum age).

(tested on chrome and firefox)

NB: when updating the manifest, the browser reloads the assets, but still displays the old version ... Only at the next download does the browser use the new assets. Why?

+4
source share
1 answer

I don’t see what the AppCache manifest is, because you want to bypass the cache and just use the network. Keep in mind that regular caching can still be applied regardless of the AppCache manifest, so check out Expires , Last-Modified and similar headers.

Regarding your question:

NB: when updating the manifest, the browser reloads the assets, but still displays the old version ... Only at the next download does the browser use the new assets. Why?

This is because the user agent immediately uses the latest cached version of your assets and then starts checking the related resources listed in the manifest for updates. When the user agent discovers that the manifest has been modified and therefore needs to check for updates, it fires a checking event.

When the update check process is complete (and may take a long time if you have a lot of resources), it will fire the updateready event. Only the resources extracted after this event will be fresh new (which is usually advised to use window.applicationCache.swapCache() to tell the browser to exchange the old cache for a new one to load the next page or just reload the page and execute with it).

Below you will find more detailed explanations on these topics: http://www.html5rocks.com/en/tutorials/appcache/beginner/

0
source

All Articles