We use html5 application cache in our 3G version website project, and place most of the image resources, js, css and other static resources in the manifest file. Friends who need to know more can refer to the following
In our 3G version website project, we use html5 application cache and place most of the image resources, js, css and other static resources in the manifest file.
I didn’t expect to encounter a serious problem on the first day of going online: the application cache will cache the current page by default! ! ! Even if we have the following settings:
The code is as follows:
NETWORK:*
In other words, for all dynamic pages, the application cache will cache them, and they will be old no matter how the user refreshes them!
Moreover, it is difficult to clear it on mobile browsers, and it does not support js clearing!
I spent a whole morning, tried many methods and checked a lot of information, but could not clear the client cache. There have been a lot of complaints from users all morning.
In the end, the almighty stackoverflow saved me:
Do not use appcache unless it is REALLY 100% EXACTLY WHAT YOU WANT TO DO
Even if it IS 100% EXACTLY WHAT YOU WANT TO DO, *DO NOT* use appcache until you are 100% CERTAIN that you are not going to make a single change to that page (or any file that it links to) for a LONG time.
Delete the manifest file from the server -- if the browser can't find the manifest file, then it will clear its cache... ...this will also turn caching off for everyone.
Don't turn it on again until it's 100% CORRECT
Dealing with appcache is miserable, often.
The solution is simple, delete the manifest file on the server side, and use the application cache with caution
Of course, There is also a way to use application cache, which can also bypass the problem of automatically caching the current page. That is to use iframe
For more related tutorials, please visit Html5 video tutorial