How to use srcache_store while proxy_pass use to connect backend

agentzh agentzh at gmail.com
Thu Mar 8 06:01:52 UTC 2012


On Thu, Mar 8, 2012 at 1:51 PM, n1xman <nginx-forum at nginx.us> wrote:
> /var/log/nginx/error.log
> http://pastebin.com/W7Jk3sq8
>

The line 182 in your error.log snippet gives you the answer:

2012/03/08 10:49:10 [debug] 20521#0: *11 srcache_store skipped due to
response header Cache-Control

That is, the response from your backend server explicitly prohibits
caching via the Cache-Control response header. And the line 191 in
your error.log snippet confirms this:

Cache-Control: no-cache

If you want to enforce caching in this very case, just turn on the
srcache_store_no_cache config directive, like

    srcache_store_no_cache on;

See http://wiki.nginx.org/HttpSRCacheModule#srcache_store_no_cache for
more details.

Or turn off the srcache_response_cache_control config directive to
make ngx_srcache ignore the Cache-Control response header altogether:

    srcache_response_cache_control off;

See http://wiki.nginx.org/HttpSRCacheModule#srcache_response_cache_control
for more details.

Best regards,
-agentzh



More information about the nginx mailing list