add "Expires" and "Cache-Control" headers to the response
@ if your content changes in specific intervals like every 15 minutes.
]]>
adds an "Expires" header to the response
the rule to calculate the "Expires" header value with
[plus] ( )+
* @@ is one of "access", "now" or "modification"; "now" being equivalent to "access".
* "@plus@" is optional and does nothing.
* @@ is any positive integer.
* @@ is one of "seconds, "minutes", "hours", "days", "weeks", "months" or "years".
The trailing "s" in @@ is optional.
If you use "modification" as @@ and the file does not exist or cannot be accessed, mod_expire will do nothing and request processing will go on.
The expire action will overwrite any existing "Expires" header.
It will append the max-age value to any existing "Cache-Control" header.
]]>
Cache image, css, txt and js files for 1 week.
setup {
module_load "mod_expire";
}
if req.path =~ "\.(jpe?g|png|gif|txt|css|js)$" {
expire "access plus 1 week";
}