Home > WeChat Applet > WeChat Development > Detailed instructions on how to cancel cache on WeChat browser

Detailed instructions on how to cancel cache on WeChat browser

高洛峰
Release: 2017-03-16 14:40:19
Original
2332 people have browsed it

This article mainly introduces the detailed description of the method of canceling the cache of WeChat browser. This article uses meta header information to cancel the cache of WeChat browser, which is often used especially during development. It needs Friends can refer to the following

When making a WeChat official account and

Debugging the mobile page, it is inevitable that the page will jump to the WeChat browser to open the debugging stage, android The WeChat browser has always cached htmlstatic resources by default. Every time the static resources change or even when new content is released, it is very likely that the WeChat browser cannot be updated, and many times it has to You have to clear the WeChat cache to see the effect, which is very annoying. Some customers have installed QQ Browser, and WeChat actually calls QQ Browser. Sometimes even clearing the WeChat cache is ineffective, and the QQ Browser cache must also be cleared.

After some exploration, the WeChat browser does indeed cache the upper layer of the webview: that is, if the request passes this address, it will be stored locally and will not be retrieved online later.

The solution is to add the following header information during the debugging phase or frequently updated pages.

The code is as follows:

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
Copy after login

Well, in this way, the WeChat browser will treat this page It will be pulled online all the time.

The above is the detailed content of Detailed instructions on how to cancel cache on WeChat browser. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template