Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import std;
- backend default {
- .host = "87.98.200.165";
- .port = "80";
- }
- sub vcl_recv
- {
- std.syslog(1, "RECV: " + req.url);
- if(
- req.request != "GET" &&
- req.request != "HEAD"
- )
- {
- std.syslog(1, "RECV > RETURN PIPE: " + req.url);
- return (pipe);
- }
- std.syslog(1, "RECV > RETURN LOOKUP: " + req.url);
- # Lookup even if cookies! (we will decide whether to cache in vcl_fetch() based on X-Kigo-WS-Cache server header)
- return (lookup);
- }
- sub vcl_fetch
- {
- std.syslog(1, "FETCH: " + req.url);
- if(
- beresp.http.X-Kigo-WS-Cache == "Yes" &&
- beresp.ttl > 0s &&
- !beresp.http.Set-Cookie &&
- beresp.http.Vary != "*"
- )
- {
- std.syslog(1, "FETCH > RETURN DELIVER: " + req.url);
- return (deliver);
- }
- std.syslog(1, "FETCH > RETURN HIT_FOR_PASS: " + req.url);
- return (hit_for_pass);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement