Welcome! Log In Create A New Profile

Advanced

Re: NGINX as proxy before apache, and localy store php generated images

September 28, 2012 05:26AM
On Sep 28, 2012, at 13:15 , Jaroslav wrote:

> Thank you very much Igor for a fast response!
>
> So far I see the performance increase. I see the logs being created. And no longer see so lot access logs to apache images.
>
> my config is:
> location /bin/ {
> expires 7d;
> add_header X-Cache "Backend2-cache";
> proxy_pass http://site.com;
>
> proxy_cache my-cache;
> proxy_cache_valid 200 302 360m;
> proxy_cache_valid 404 1m;
> }
>
> One more question is left in my mind, I see the expire headers are set, but the HTTP response status is always 200.
> is there somewhere a way to make it respond with status 304 (not modified) ?

Do these images have "Last-Modified" or "ETag" header field ?


--
Igor Sysoev
http://nginx.com/support.html

> Thank you
>
> On 28 September 2012 11:26, Igor Sysoev <igor@sysoev.ru> wrote:
> On Sep 28, 2012, at 12:10 , Jaroslav wrote:
>
>> Hello everyone,
>>
>> I am using nginx as proxy before apache a long time already. And it is really terrific what it does.
>> Ram usage dropped like 3 times
>> I mainly set up image cache headers in nginx config
>>
>> Today I've spotted, that one of vhosts is generating images ALWAYS on the fly, images are accessed like:
>> /bin/825?w=121&h=87&cutted=fit
>> /bin/4999?w=222
>> /bin/5113?w=121&h=87&cutted=fit
>>
>> etc..
>>
>> I wonder is there any way I can tell nginx to store those images locally, ie for a week, and serve them
>> to other users, so it won't be resized multiple times?
>>
>> I tried googling but don't even know how/where to start from..
>
> http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache
>
>
> --
> Igor Sysoev
> http://nginx.com/support.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

NGINX as proxy before apache, and localy store php generated images

Jaroslav September 28, 2012 04:12AM

Re: NGINX as proxy before apache, and localy store php generated images

Igor Sysoev September 28, 2012 04:28AM

Re: NGINX as proxy before apache, and localy store php generated images

Jaroslav September 28, 2012 05:16AM

Re: NGINX as proxy before apache, and localy store php generated images

Igor Sysoev September 28, 2012 05:26AM

Re: NGINX as proxy before apache, and localy store php generated images

Jaroslav September 28, 2012 05:32AM

Re: NGINX as proxy before apache, and localy store php generated images

Igor Sysoev September 28, 2012 05:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 149
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready