HTTP Cache-control Catalyst Control Center LED control system AMD Catalyst Control Cente

Source: Internet
Author: User
Tags browser cache
expires is a Web server response message header field that, in response to an HTTP request, tells the browser that the browser can cache data directly from the browser before the expiration time, without having to request it again.

Cache-control is consistent with expires, which indicates the validity of the current resource, whether the browser caches data directly from the browser or re-sends the request to the server. But Cache-control more choice, more detailed settings, if set at the same time, its priority is higher than expires.

1, the common value of HTTP protocol Cache-control and its combination of interpretation:
No-cache: The data content cannot be cached, each request is re-accessed to the server, and if there is max-age, the server is not accessed during the cache.
No-store: Not only can not cache, even staging is not possible (that is, the temporary folder cannot be staged in the resource)
Private (default): Only in the browser cache, only when the first request to access the server, if there is max-age, the cache during the server is not accessed.
Public: can be cached by any buffer, such as: Browser, server, proxy server, etc.
Max-age: The relative expiration time, which is the cache time in seconds.
No-cache, Private: Re-access the server when a new window is opened, and if Max-age is set, the server is not accessed during the cache.
Private, Positive max-age: Do not access the server when back
No-cache, Positive max-age: accesses the server when back

2. Setting Cache-control in a request message or response message does not affect the caching process in another message processing process.
the cache instructions for the request include No-cache, No-store, Max-age, Max-stale, Min-fresh, only-if-cached, and so on.

The directives in the response message include public, private, No-cache, No-store, No-transform, Must-revalidate, Proxy-revalidate, and Max-age.

3, Nginx settings:

1) If expires is not configured in Nginx, the default in response is Cache-control:private

2) Set EXPIRES-1, the response is Cache-control:no-cache

3) Add_header Cache-control No-store can be set in the response; The response is:cache-control:private cache-control:no-store

Location ~ ^/{                expires-1;                #add_header Cache-control No-store;                Proxy_pass   http://api.yuedu.web;        }

The above describes the HTTP Cache-control, including the control,cache aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.