Welcome! Log In Create A New Profile

Advanced

setting expires header

Posted by s1r0n 
setting expires header
June 10, 2012 04:36PM
hi there. i have an nginx server setup. i'm just about ready to dump apache and go live but I want to do a few load optimizations first. figure the first step would be to set expirses headers so I do this

location ~* \.(ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public";
}


but it doesn't work. i don't get an expires header when I look at it

HTTP/1.1 200 OK
Server: nginx/0.8.55
Date: Sun, 10 Jun 2012 20:34:43 GMT
Content-Type: image/jpeg
Content-Length: 16985
Last-Modified: Thu, 24 May 2012 20:25:16 GMT
Connection: keep-alive
Accept-Ranges: bytes


can anybody help. what's I doing wrong?

also, and quick tips on how to prepare nginx for high load?
Re: setting expires header
June 10, 2012 10:13PM
s1r0n Wrote:

never mind. figured it out
-------------------------------------------------------
> hi there. i have an nginx server setup. i'm just
> about ready to dump apache and go live but I want
> to do a few load optimizations first. figure the
> first step would be to set expirses headers so I
> do this
>
> location ~* \.(ico|css|js|gif|jpe?g|png)$ {
> expires max;
> add_header Pragma public;
> add_header Cache-Control
> "public";
> }
>
>
> but it doesn't work. i don't get an expires header
> when I look at it
>
> HTTP/1.1 200 OK
> Server: nginx/0.8.55
> Date: Sun, 10 Jun 2012 20:34:43 GMT
> Content-Type: image/jpeg
> Content-Length: 16985
> Last-Modified: Thu, 24 May 2012 20:25:16 GMT
> Connection: keep-alive
> Accept-Ranges: bytes
>
>
> can anybody help. what's I doing wrong?
>
> also, and quick tips on how to prepare nginx for
> high load?
Re: setting expires header
June 22, 2012 01:43PM
Care to share?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 197
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready