Advertisement
shakalandy

Varnish Default Config

Apr 1st, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | None | 0 0
  1. backend default {
  2.     .host = "127.0.0.1";
  3.     .port = "8080";
  4. }
  5.  
  6.  
  7. # Drop any cookies sent to Wordpress.
  8. # except when previewing
  9. sub vcl_recv {
  10.     if ( !(req.url ~ "(wp-login|wp-admin|preview=true)") ) {
  11.         unset req.http.cookie;
  12.     }
  13. }
  14.  
  15. # Drop any cookies Wordpress tries to send back to the client.
  16. # except when previewing
  17. sub vcl_fetch {
  18.     if ( !(req.url ~ "(wp-login|wp-admin|preview=true)") ) {
  19.         unset beresp.http.set-cookie;
  20.     }
  21. }
  22.  
  23. sub vcl_deliver {
  24.   if (obj.hits > 0) {
  25.     set resp.http.X-Cache = "HIT";
  26.   } else {
  27.     set resp.http.X-Cache = "MISS";
  28.   }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement