Pragma:no-cache

Source: Internet
Author: User

PHP Advanced and object-oriented Programminglarry Ullman last-modified Last modified time expires expiration pragma compile hint Cache-control Cache control such as the cache system discovers that the value of last-modified is closer to the current time than the page cache version, it knows that the updated page version from the server should be used.

Caching-both in Web browsers and proxy Servers-can is affected using PHP ' s header () function. Four header types is involved:

last-modified

expires

pragma

Cache-control

The first three header types is part of the HTTP 1.0 standard. The last-modified header uses a UTC (coordinated Universal time) date-time value. If a caching system sees that the last-modified Valueis more recent than the date on the cached version of the page, it kn oWS to use the new version from the server. Expires is used as a indicator as to when a cached version of the page should no longer be used (Ingreenwich Mean time).

Setting an Expires value in the past should all force the page from theserver to be used:

Header ("Expires:mon, Jul 1997 05:00:00 GMT");

Pragma is just a declaration for how the page data should be handled. To avoid caching of a page, use

Header ("Pragma:no-cache")

The Cache-control headers were added in HTTP 1.1 and are a more finely tuned option.

Directive meaning

Public Can be cached anywhere

Private only cached by browsers

No-cache cannot be cached anywhere

Must-revalidate Caches must check for newer versions

Proxy-revalidate Proxy caches must check for newer versions

Max-age A duration, in seconds, then the content is cacheable

S-maxage Overrides The Max-age value for shared caches

Keep all systems from caching a page

Header ("Last-modified:mon, 05:00:00 GMT"); Right now!

Header ("Expires:mon, Jul 1997 05:00:00 GMT"); The Back then!

Header ("Pragma:no-cache");

Header ("Cache-control:no-cache");

Pragma:no-cache

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.