forced caching

Rami Essaid rami.essaid at
Tue Jul 26 14:00:42 UTC 2011

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

    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 {


On Tue, Jul 26, 2011 at 5:55 AM, Dennis Jacobfeuerborn <
dennisml at> 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 at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list