Has the browser cached webpages on WeChat that should not be cached?

Source: Internet
Author: User
The server uses the python flask framework to return the static file code as follows: flask. send_file (& #039 ;.. staticjsmain. js & #039;, cache_timeout0) requestheaders: {code ...} responseheaders: {code ...} there is no problem in chrome. in... the server uses the python flask framework.
The code for returning static files is as follows:
Flask. send_file ('../static/js/main. js', cache_timeout = 0)

The request headers is as follows:

GET /static/js/main.js?__inline=true HTTP/1.1Host: anglestreet.duapp.comConnection: keep-aliveCache-Control: max-age=0Accept: */*If-None-Match: "flask-1409227359.0-21401-527044139"If-Modified-Since: Thu, 28 Aug 2014 12:02:39 GMTUser-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/36.0.1985.125 Chrome/36.0.1985.125 Safari/537.36DNT: 1Referer: http://anglestreet.duapp.com/Accept-Encoding: gzip,deflate,sdchAccept-Language: zh,zh-CN;q=0.8Cookie: BAEID=81F2D83EAD7D00091521BA62EDC1894B:FG=1; 

Response headers:

HTTP/1.1 200 OKContent-Type: application/javascriptLast-Modified: Thu, 28 Aug 2014 12:02:39 GMTCache-Control: public, max-age=0Expires: Fri, 29 Aug 2014 15:21:59 GMTETag: "flask-1409227359.0-21401-527044139"Set-Cookie: session=eyJyb2xlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluIn0.BuIsFw.LKeoAWvqoRfNYlU-Sk1kaz-icc4; HttpOnly; Path=/Date: Fri, 29 Aug 2014 15:21:59 GMTServer: BWS/1.0Content-Length: 21401

There is no problem in chrome. If you open the link, the version will often expire. You must refresh it manually.

Reply content:

The server uses the python flask framework.
The code for returning static files is as follows:
Flask. send_file ('../static/js/main. js', cache_timeout = 0)

The request headers is as follows:

GET /static/js/main.js?__inline=true HTTP/1.1Host: anglestreet.duapp.comConnection: keep-aliveCache-Control: max-age=0Accept: */*If-None-Match: "flask-1409227359.0-21401-527044139"If-Modified-Since: Thu, 28 Aug 2014 12:02:39 GMTUser-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/36.0.1985.125 Chrome/36.0.1985.125 Safari/537.36DNT: 1Referer: http://anglestreet.duapp.com/Accept-Encoding: gzip,deflate,sdchAccept-Language: zh,zh-CN;q=0.8Cookie: BAEID=81F2D83EAD7D00091521BA62EDC1894B:FG=1; 

Response headers:

HTTP/1.1 200 OKContent-Type: application/javascriptLast-Modified: Thu, 28 Aug 2014 12:02:39 GMTCache-Control: public, max-age=0Expires: Fri, 29 Aug 2014 15:21:59 GMTETag: "flask-1409227359.0-21401-527044139"Set-Cookie: session=eyJyb2xlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluIn0.BuIsFw.LKeoAWvqoRfNYlU-Sk1kaz-icc4; HttpOnly; Path=/Date: Fri, 29 Aug 2014 15:21:59 GMTServer: BWS/1.0Content-Length: 21401

There is no problem in chrome. If you open the link, the version will often expire. You must refresh it manually.

The problem is that when Cache-Control: public, max-age = 0 is set to Cache-Control: private, the page will not be cached.

I encountered the same problem in the following scenarios:
Only the number of likes can be displayed on page a. Click the likes icon to Go to page B. Click likes or cancel likes on page B.

Now, the number of likes on page a is 0. When I click likes on page B, I click back on the Android phone to return to page a. However, the number of likes on page a does not increase by 1... I tried a lot of methods, but I cannot solve the problem.

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.