varnish-vcl

Magento Multi language store with varnish

亡梦爱人 提交于 2019-12-04 09:38:07
问题 How Multi-Language Magento store work with Varnish. Is there any configuration available in varnish,so we can create cache base on cookies? 回答1: If you don't mind the languages being at different urls, Turpentine can handle this for you: https://github.com/nexcess/magento-turpentine/issues/36 If you want them to behave as they do out of the box, lets keep going. You have to modify how varnish generates the has in your VCL Reference: https://www.varnish-cache.org/trac/wiki

How to Set Varnish Cache-Control Headers

烂漫一生 提交于 2019-12-03 19:30:49
问题 I am hoping someone can advise on the proper method for getting Varnish to send cache-control headers. Currently, my configuration is sending "Cache-Control: no-cache" to clients. Thanks in advance to anyone who might be able to help... 回答1: Your back-end is sending "Cache-Control: no-cache" to Varnish which implies two things: Varnish will not store the response in the cache (so a next lookup will fail) Your clients (browsers and intermediate proxies) will not cache responses (and request

varnish 503 service unavailable

谁都会走 提交于 2019-12-03 10:05:51
问题 My varnish version is 3.0 . My server works well while I curl the URLs, but when use varnish cache it return 503 service unavailable occasionally. The log info likes is: 0 Debug - "VCL_error(200, OK)" 24 VCL_call c recv error 24 VCL_call c error deliver 24 SessionClose c error 0 Debug - "VCL_error(200, OK)" 27 VCL_call c recv error 27 VCL_call c error deliver 27 SessionClose c error 0 Debug - "VCL_error(200, OK)" 16 VCL_call c recv error 16 VCL_call c error deliver 16 SessionClose c error 14

Varnish hit-for-pass means?

与世无争的帅哥 提交于 2019-12-03 01:28:38
问题 As Varnish Version 3 has some objects for different operations. For Example, pass is used when it has to retrieve data from backend. and it uses hit when it finds requesting content in cache. But I cant understand usage of hit-for-pass. when varnish uses it ? I haven't found any useful material on net which make me clear. 回答1: A hit_for_pass object is made to optimize the fetch procedure against a backend server. For ordinary cache misses, Varnish will queue all clients requesting the same

varnish 503 service unavailable

百般思念 提交于 2019-12-03 00:40:37
My varnish version is 3.0 . My server works well while I curl the URLs, but when use varnish cache it return 503 service unavailable occasionally. The log info likes is: 0 Debug - "VCL_error(200, OK)" 24 VCL_call c recv error 24 VCL_call c error deliver 24 SessionClose c error 0 Debug - "VCL_error(200, OK)" 27 VCL_call c recv error 27 VCL_call c error deliver 27 SessionClose c error 0 Debug - "VCL_error(200, OK)" 16 VCL_call c recv error 16 VCL_call c error deliver 16 SessionClose c error 14 Debug - "Write error, retval = 2998272, len = 8465870, errno = Success" 0 Debug - "VCL_error(200, OK)"

Varnish hit-for-pass means?

泪湿孤枕 提交于 2019-12-02 16:43:11
As Varnish Version 3 has some objects for different operations. For Example, pass is used when it has to retrieve data from backend. and it uses hit when it finds requesting content in cache. But I cant understand usage of hit-for-pass. when varnish uses it ? I haven't found any useful material on net which make me clear. lkarsten A hit_for_pass object is made to optimize the fetch procedure against a backend server. For ordinary cache misses, Varnish will queue all clients requesting the same cache object and send a single request to the backend. This is usually quickest, letting the backend

Deliver stale content after error fetch in Varnish 4 before “probe” marks the server unhealth

佐手、 提交于 2019-12-01 11:03:57
I'm using stale-if-error to deliver stale content while the server is marked unhealthy looking at grace and keep object options in vcl_hit . The question is: Is it possible to deliver a cache object after entering the vcl subroutine vcl_backend_error (fresh request error). Actually, I deliver cached object at vcl_hit but looking at the next diagram, I don't see how it is possible to access the cached object of that request. Source: https://www.varnish-software.com/book/4.0/chapters/VCL_Basics.html When using the built-in VCL (see code bellow): # Built-in 'vcl_hit'. sub vcl_hit { if (obj.ttl >=

Deliver stale content after error fetch in Varnish 4 before “probe” marks the server unhealth

蓝咒 提交于 2019-12-01 07:52:44
问题 I'm using stale-if-error to deliver stale content while the server is marked unhealthy looking at grace and keep object options in vcl_hit . The question is: Is it possible to deliver a cache object after entering the vcl subroutine vcl_backend_error (fresh request error). Actually, I deliver cached object at vcl_hit but looking at the next diagram, I don't see how it is possible to access the cached object of that request. Source: https://www.varnish-software.com/book/4.0/chapters/VCL_Basics

Change backend during retry in Varnish 4

旧街凉风 提交于 2019-12-01 03:46:58
I'd like to be able to change the backend on a retry in Varnish 4. We've got this working on a different (older) application using Varnish 3, but I haven't been able to figure it out for v4, nor find much documentation. The setup we want is to have 2 sets of directors - one for the initial request trying a local server in the same datacenter as varnish because this is way faster, and then only if that fails, pick randomly from a different director for servers in other datacenters. In v3, this was easy: sub vcl_recv { if (req.restarts == 0) { set req.backend = defaultdirector; } else { set req

Varnish: how to separately cache pages based on value of a specific cookie

流过昼夜 提交于 2019-11-30 17:33:55
问题 I manage a site that has a single cookie, which we have to use, but will always be one of 9 values (including no value). I'd like to use varnish in front of our application servers, with varnish separately caching a version of each page based on the cookie value. So if we have page /page1, Varnish should separately manage a copy of what /page1 looks like with cookie values a, b, c, d, etc.... Assume we have plenty of memory on the Varnish server to handle storing all pages with all cookie