Welcome! Log In Create A New Profile

Advanced

Re: forced caching

July 26, 2011 10:02AM
I am sure there is a better way but here is a suggestion. Use the rate
limit to identify when there is more than one connection per minute and
redirect that to the cache, if it doesnt hit that limit then you can use the
cache_bypass. Not sure if this would work hope someone can confirm, but a
thought.

limit_req_zone $binary_remote_addr zone=one:10m rate=1r/m;
location / {

limit_req zone=one burst=1 nodelay;
error_page 503 = @cached;
set $http_my_secret_header "0"; proxy_cache_bypass $http_my_secret_header;

location @cached {

proxy_pass
}


Rami
On Tue, Jul 26, 2011 at 5:55 AM, Dennis Jacobfeuerborn <
dennisml@conversis.de> wrote:

> Hi,
> what is the easiest way to force all request to be satisfied from the cache
> for lets say a minute? What I'm basically trying to do is to rate-limit the
> requests to the proxy upstream so that the upstream server will see no more
> than for example one request per minute for a specific url.
>
> Regards,
> Dennis
>
> ______________________________**_________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/**mailman/listinfo/nginxhttp://mailman.nginx.org/mailman/listinfo/nginx
>



--
Cheers,
Rami
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

forced caching

Dennis Jacobfeuerborn July 26, 2011 05:56AM

Re: forced caching

ressaid July 26, 2011 10:02AM

Re: forced caching

Zeljko Tomic July 26, 2011 10:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 180
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