Javascript-a WeChat website is built with two templates switched, but there is a cache and the effect cannot be viewed immediately. you need to re-log on to WeChat. how can this problem be solved?

Source: Internet
Author: User
After a website is built, two templates are switched, but there is a cache and the effect cannot be viewed immediately. you need to re-register the website. how can this problem be solved for a website and two templates are switched, however, if there is a cache, you cannot view the effect immediately. you need to re-register it. how can this problem be solved?

Reply content:

After a website is built, two templates are switched, but there is a cache and the effect cannot be viewed immediately. you need to re-register the website. how can this problem be solved?

  1. In my opinion, you can prompt the user to log on again based on the detection template status change.

  2. Find the reason for caching. do you want to disable caching based on the events you switch. This will automatically update based on your usage.

If it is a server cache, you can perform a delete operation during the switchover.
If it is the cache of the local browser, you do not know how to do it.

Add a random number after the request file name.

Cache is a measure of its built-in QQ browser kernel, but you try to changeEtagIn this way, the browser finds two times before and afterEtagThe difference will not be read from the cache, but will be retrieved from your server again

It has its own cache. it is recommended that the template be switched on the front-end and the data be loaded asynchronously.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.