对于正常的公共页面,我做了一个
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;
caching内容。
是否有per user或基于IP的caching机制,将允许我caching内容。
我的主要目的是为了防止快速刷新,用户在短时间内(例如30秒或一分钟内)caching页面。
我了解NAT的含义。 但是我很好。
只需将相应的信息添加到proxy_cache_key。 如果要caching每个客户端地址,请添加$ remote_addr或$ binary_remote_addr。 如果您想基于cookie进行区分,请将$ cookie_NAME添加到密钥。 你可以在http://wiki.nginx.org/HttpCoreModule#Variables看到很多可用的variables。