Home >Backend Development >PHP Tutorial >javascript - I built a WeChat website and switched between two sets of templates, but there is a cache and the effect cannot be viewed immediately. I have to log in to WeChat again. How to solve this problem?

javascript - I built a WeChat website and switched between two sets of templates, but there is a cache and the effect cannot be viewed immediately. I have to log in to WeChat again. How to solve this problem?

WBOY
WBOYOriginal
2016-09-21 14:12:531146browse

I built a WeChat website and switched between two sets of templates, but there is a cache and the effect cannot be viewed immediately. I have to log in to WeChat again. How to solve this problem?

Reply content:

I built a WeChat website and switched between two sets of templates, but there is a cache and the effect cannot be viewed immediately. I have to log in to WeChat again. How to solve this problem?

  1. Personally, I think the user can be prompted to log in again based on the status change based on the detection template.

  2. Find the cause of the cache and see if you can not clear the cache based on the event you switch. This will automatically update based on user usage.

If it is the server's cache, it can be deleted when switching.
If it’s the local browser’s cache, then I don’t know how to fix it.

Add #random number after the request file name. I don’t know if it will work

WeChat cache is a measure of its built-in QQ browser kernel. You can try to change the etag for each request, so that the browser finds that the two etag are different and will not read from the cache but from the cache again. Get it once on your server

WeChat has its own cache. It is recommended to switch templates on the front end and load data asynchronously

Statement:
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