The best configuration for serving static content

Maxim Dounin mdounin at mdounin.ru
Mon Dec 5 16:33:48 UTC 2011


Hello!

On Mon, Dec 05, 2011 at 04:22:19PM +0000, António P. P. Almeida wrote:

> On 5 Dez 2011 10h29 WET, nginx-forum at nginx.us wrote:
> 
> > location ~ \.(css|js|jpg|jpeg|png|gif)$ {
> > expires 31536000s;
>           ^^^^^^^^^
> Why don't you use:
> 
> expires 1y; 
> 
> It's easier to understand IMO.

The whole location in question is a nop (it's never matched as 
previous one will always win), so it doesn't really matter.

Maxim Dounin



More information about the nginx mailing list