[英]Caching with Varnish & Varying over custom-set HTTP headers
I'm developing your standard high traffic ecommerce website and want to setup caching with Varnish. 我正在开发您的标准高流量电子商务网站,并希望使用Varnish设置缓存。 The particular thing on this setup is that the application will return different content depending on the user's particular location.
此设置的特别之处在于,应用程序将根据用户的特定位置返回不同的内容。
So my plans are these: 所以我的计划是:
Does anyone have experience with a setup like this? 有人有这样的设置经验吗? Anything I should be aware of?
我应该注意什么?
If GeoIP lookup is slow, and/or you want to enable people to override the country setting, you could use a country cookie and have the front-end Varnish check for it. 如果GeoIP查找速度很慢,并且/或者您想让人们覆盖国家/地区设置,则可以使用国家/地区 Cookie,并进行前端Varnish检查。
Set-Cookie: country=us
header. Set-Cookie: country=us
标头提供重定向。 If you want to avoid redirects and support cookie-refusing clients/robots, ngingx can forward it to Rails and still try to set the country cookie in the response. If Rails can do GeoIP resolving, you don't need Ngingx, except when you use it to serve files... 如果Rails可以进行GeoIP解析,则不需要Ngingx,除非您使用它来提供文件...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.