What does `expires -1` mean in NGINX` location` directive?

For the example location

below, what does it mean -1

for expires

? Does this mean "never expires" or "never cached"?

# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
  expires -1;
  access_log logs/static.log;
}

      

https://github.com/h5bp/server-configs-nginx/blob/master/h5bp/location/expires.conf

+3


source to share


2 answers


According nginx could manual , the directive adds HTTP-header Expires

and Cache-Control

back.

The value -1

means that these headers are specified as:



Expires:

current time minus 1 second

Cache-Control: no-cache

So, in short, it instructs the browser not to cache the document.

+4


source


If used expires -1

, it means that these pages are never cached. The directive expire

tells the browser to expire the file cache after a certain time (or at a certain time). If set to a negative value, there is no caching.



+3


source







All Articles