varnish-vcl

Stripping out select querystring attribute/value pairs so varnish will not vary cache by them

故事扮演 提交于 2019-11-30 05:15:59
My goal is to "whitelist" certain querystring attributes and their values so varnish will not vary cache between the urls. Example: Url 1: http://foo.com/someproduct.html?utm_code=google&type=hello Url 2: http://foo.com/someproduct.html?utm_code=yahoo&type=hello Url 3: http://foo.com/someproduct.html?utm_code=yahoo&type=goodbye In the above example I want to whitelist "utm_code" but not "type" So after the first url is hit I want varnish to serve that cached content to the second url. However, in the case of the third url, the attribute "type" value is different so that should be a varnish

How to debug VCL in varnish?

回眸只為那壹抹淺笑 提交于 2019-11-30 03:14:50
How can I print a log in VCL? Can I print log info on screen? Can I do like this? sub vcl_recv { .... log.info(req.http.host); // can i write a log here? .... } ghloogh You can see URL with requested URLs varnishlog utility (it able to write log files) varnishlog -i RxURL Or output some info to syslog with vmod std and syslog function for Varnish 3.x https://www.varnish-cache.org/docs/trunk/reference/vmod_std.html#syslog Varnish 5.1 https://varnish-cache.org/docs/5.1/reference/vmod_std.generated.html#func-syslog Example: import std; sub vcl_recv { ... std.syslog(180, "RECV: " + req.http.host +

Varnish Client IP not logging in Apache Logs

谁说我不能喝 提交于 2019-11-29 15:20:02
问题 I've configured Varnish 3 with Apache and it is running perfectly alright. However i'm unable to get the Client ip logged in Apache logs. I tried a few solutions googling around with no luck. Right now my Apache access log file is logging the server IP instead of client IP addresses. Here are my configurations for your kind consideration: Varnish VCL: (/etc/varnish/default.vlc): http://pastebin.com/PuBqZ6fx Apache Config /etc/httpd/conf/httpd.conf LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\

Stripping out select querystring attribute/value pairs so varnish will not vary cache by them

廉价感情. 提交于 2019-11-29 02:49:50
问题 My goal is to "whitelist" certain querystring attributes and their values so varnish will not vary cache between the urls. Example: Url 1: http://foo.com/someproduct.html?utm_code=google&type=hello Url 2: http://foo.com/someproduct.html?utm_code=yahoo&type=hello Url 3: http://foo.com/someproduct.html?utm_code=yahoo&type=goodbye In the above example I want to whitelist "utm_code" but not "type" So after the first url is hit I want varnish to serve that cached content to the second url. However

How to debug VCL in varnish?

喜欢而已 提交于 2019-11-29 00:20:54
问题 How can I print a log in VCL? Can I print log info on screen? Can I do like this? sub vcl_recv { .... log.info(req.http.host); // can i write a log here? .... } 回答1: You can see URL with requested URLs varnishlog utility (it able to write log files) varnishlog -i RxURL Or output some info to syslog with vmod std and syslog function for Varnish 3.x https://www.varnish-cache.org/docs/trunk/reference/vmod_std.html#syslog Varnish 5.1 https://varnish-cache.org/docs/5.1/reference/vmod_std.generated