Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if html5 application cache has a serious problem?

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you what to do when html5 application cache encounters serious problems. I hope you will get something after reading this article. Let's discuss it together.

In the project of our 3G version of the website, html5 application cache is used to put most of the picture resources, js, css and other static resources in the manifest file.

Unexpectedly, there was a serious problem on the first day of launch: 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, application cache will be cached, and no matter how users refresh it, it will be old!

And mobile browsers are also very difficult to clear, and do not support js removal!

Spent the morning, tried a lot of methods, checked a lot of information, failed to clear the client's cache. I was badly complained by 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 application cache carefully

Of course, there is also a way to use application cache while bypassing the problem of automatically caching the current page. That is to use iframe

After reading this article, I believe you have a certain understanding of "what to do when html5 application cache encounters serious problems". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report