I think use proxy_cache_key to define caching key is good idea .
but I do not know which variable to use that can distinguish client side
support compressed or compressed content and store the different cache
Can Igor S. help me . Thanks a lot.
·¢¼þÈË: Miros?aw Jaworski [mailto:[email protected]]
·¢ËÍÊ±¼ä: 2010Äê3ÔÂ4ÈÕ 2:25
ÊÕ¼þÈË: [email protected]
Ö÷Ìâ: Re: help about how proxy_cache to store differet cache file by
httpheader vary Accept-Encoding like squid
On Thu, 2010-03-04 at 01:19 +0800, yangchunyu wrote:
We use nginx as reserve proxy server and want use proxy_cache to replace
There are apache servers behind nginx, we use deflate module to compress
The problem is if proxy_cache has cached the compressed page but the
client side that request page does not support uncompress, the page can
be see correctly.
I know squid using http header Accept-Encoding to store different cache
file, but there is no way to use it in nginx proxy_cache_key.
You can try to use proxy_cache_key to define caching key ( i don’t
know however if you find variable that will do trick ).
The other method i would think of is not letting nginx to cache
compressed content. And i don’t mean caching or not depend on
whether backend response is compressed or not - i mean forcing
uncompressed transmission between nginx and backends.
You may even gain another benefit - lessen the compression burden
on backends which may give you spare cpu cycles on them.
proxy_set_header Accept-Encoding “”;
in proxying location is the way to go.
Miroslaw “Psyborg” Jaworski
GCS/IT d- s+:+ a C++$ UBI++++$ P+++$ L- E— W++(+++)$ N++ o+ K- w-- O-
M- V- PS+ PE++ Y+ PGP t 5? X+ R++ !tv b++(+++) DI++ D+ G e* h++ r+++ y?
nginx mailing list