Nginx Cache Time Description

Source: Internet
Author: User

Cached data that is not accessed during the time specified by the inactive parameter get removed from the cache Regardless of their freshness. By default,inactive are set to ten minutes.

(cached data is removed from the cache if it is not accessed within the time specified by the inactive parameter, regardless of whether it was just generated.) The default value for inactive is 10 minutes)

Sets caching time for different response codes. For example, the following directives

Proxy_cache_valid 302 10m;

proxy_cache_valid 404 1m;

Set of minutes of caching for responses with codes and 302, and 1 minute for responses with code 404.


Expires: Controls Whether the response should be marked with a expiry time, and if so, what time is.

Here is the summary:

Inactive time indicates that a file has not been accessed within a specified time and is removed from the storage system, regardless of the amount of time you set in the Proxy_cache_valid. The Proxy_cache_valid is the longest available time in terms of guaranteed access within inactive time. Proxy_cache_valid defines an absolute expiration time (the first cache time + the configured cache time), at which point the object is considered to be out of date and then goes back to end multiplicity to fetch the data, although it is accessed very frequently (that is, in the so-called inactive time). Expires, it is not in this expiration control system, it is used in the response to the client, adding "Expires" header. For specific usage of the expires Directive, refer to the official wiki.


Nginx Cache Time Description

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.