HTML header File settings common <meta> settings cache

Source: Internet
Author: User
Tags html header

<meta http-equiv= "Pragma" content= "no-cache";pragma and No-cacheUsed to define the page cache and not cache pages (to speed up some browsers will cache the pages viewed by the viewer, as defined below, browsers generally do not cache pages, and browsers cannot browse offline.)
<meta http-equiv= "Cache-control" content= "No-cache", the common values are private, No-cache, Max-age, must-revalidate, etc. The default is private,Its function is divided into the following situations according to different ways of re-browsing:
1) Opens a new window with the value private, No-cache, Must-revalidate, and the server will be re-accessed when the new window is opened. If the Max-age value is specified, the server will not be re-accessed in the time within this value, for example: Cache-control:max-age=5 (indicating that access will not go to the server within 5 seconds of accessing this page)
2) in the Address bar The return value is private or must-revalidate the server will be accessed only on the first visit and will no longer be accessed at a later time. The value is No-cache, which is accessed every time. A value of max-age, the access is not repeated until it expires.
3) Press the Back button value to private, Must-revalidate, Max-age, will not be re-accessed, the value is No-cache, repeat access every time
4) Press the Refresh button no matter why the value is repeated access Cache-control value of "No-cache", access to this page does not leave a page backup in the Temporary Internet folder.
<meta http-equiv= "Expires" content= "0" >,specifies that the Expires value is a long-past time, then when you visit this network repeatedly press ENTER in the Address bar, then each time will be repeated access: Expires:fri, Dec 1999 16:00:00 GMT For example: Prohibit page in IE cache HTTP response message header settings: CacheControl = No-cache Pragma=no-cache Expires = 1 Expires is a good thing, if the Web page on the server changes frequently, set it to 0, indicating that it expires immediately.

Reference:  http://blog.sina.com.cn/s/blog_9c7ba64d01012vn2.html

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.