Nginx Configuration Cache No-cache No-store

Source: Internet
Author: User

Depending on the documentation, you can use expires to complete
The instruction adds a Expires and a cache-control to the header of the response: (If the time is a negative no-cache, the reverse max-age = #, # is the number of seconds you specify the time) information
If you do not want to cache a page, you can use expires-1; Use this relative to the header inside with Cache-control:no-cache; After testing, under IE 6,8 normal work, F5 refresh each response status code is 200, but firefox,chrome, F5 refresh is still 304, view the response header information also has Cache-control:no-cache, The page was still cached, and later, when viewed through HttpWatch, noticed a warnning with the content "the ' no-cache ' directive was used without the ' no-store ' directive. Using ' No-store ' ensures that Firefox would always re-fetch HTTP based pages and never use a previous version. " Then the Nginx configuration inside added a add_header cache-control no-store; And then test, in ie6,8, Firefox,chrmoe can be successfully cached. Further testing, found that as long as the set of No-store, do not no-cache, even if the expires time is positive, there will be no cache

In addition, if the previous page is already cached, set not cache, also restart the server, in IE, with F5 refresh or return 304, unless CTRL+F5 return 200, if you want to take effect immediately, it is best to modify the page, let the browser know that the page has been updated to retrieve the page content.


This article is from "Smile_ Youth" blog, please be sure to keep this source http://smileyouth.blog.51cto.com/7273768/1640423

Nginx Configuration Cache No-cache No-store

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.