Expires .. is there a way to set an expires header for all of jpg, gif, css, js ?

Rob Schultz rschultz7 at gmail.com
Sat Sep 6 20:46:06 MSD 2008


This is the regex that i use and for me it worked when testing with YSlow
location ~* ^.+\.(jpg|jpeg|gif|png)$ {
        access_log   off;
        expires      30d;
}


On Sat, Sep 6, 2008 at 11:36 AM, David <mishy.cth at gmail.com> wrote:

> Thanks for your replies.
>
> Chris I gave that a shot, but am testing the site with Firebug & YSlow
> (dunno if
> you've used them but it's a Yahoo thing that isolates slowdowns on page
> loads
> and makes recommendations.
>
> When I use:
>
>        location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
>            access_log        off;
>             expires           2d;
>        }
>
> The expires header is not working.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080906/3ba68064/attachment.html>


More information about the nginx mailing list