Nginx: conditional "expires" directive
António P. P. Almeida
appa at perusio.net
Tue Aug 16 18:08:02 UTC 2011
On 16 Ago 2011 19h00 WEST, nginx-forum at nginx.us wrote:
<snip>
> ^.+\.(jpg|jpeg|gif|gz|zip|flv|rar|wmv|avi|css|swf|png|htc|ico|mpeg|mpg|txt|mp3|mov|js)$
> break;
> root /opt/lampp/htdocs/randevu/public;
> #set $ccontrol "max-age=3600";
> #if ($arg_no_cache) { set $ccontrol "no-cache max-age=0";}
> #add_header Cache-Control $ccontrol;
> expires 1y;
location ~* ^.+\.(?:jpe?g|gif|gz|zip|flv|rar|wmv|avi|css|swf|png|htc|ico|mpeg|mpg|txt|mp3|mov|js)$ {
root /opt/lampp/htdocs/randevu/public;
set $cache_control max-age=31536000; # 1 year
if ($arg_no_caching) {
set $cache_control no-cache;
}
add_header Cache-Control $cache_control;
}
--- appa
More information about the nginx
mailing list