2

For normal public pages & js I do a

proxy_cache             assets;
proxy_cache_key         backend$request_uri;
proxy_cache_valid       200 302 100d;
proxy_cache_valid  404      1m;
proxy_cache_use_stale   error timeout invalid_header;

to cache content.

Is there a per user or IP based caching mechanism that will allow me to cache content.

My primary intention is cache pages for a user for short durations like 30 seconds or a minute maximum to prevent fast refreshes.

I understand the implication with NAT. But I am fine with it.

1 Answer 1

2

Just add the appropriate information to the proxy_cache_key. If you want to cache per client address, add $remote_addr or $binary_remote_addr. If you want to differentiate based on a cookie, add $cookie_NAME to the key. You can see a lot of the available variables at http://wiki.nginx.org/HttpCoreModule#Variables .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .