Skip to content

Instantly share code, notes, and snippets.

@okor
Last active December 15, 2015 14:29
Show Gist options
  • Select an option

  • Save okor/5274842 to your computer and use it in GitHub Desktop.

Select an option

Save okor/5274842 to your computer and use it in GitHub Desktop.
Varnish, cache nothing
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# Drop any cookies sent to Wordpress.
# except when previewing
# also, cache nothing
sub vcl_recv {
if ( !(req.url ~ "(wp-login|wp-admin|preview=true)") ) {
return (pass);
}
}
# Drop any cookies Wordpress tries to send back to the client.
# except when previewing
sub vcl_fetch {
if ( !(req.url ~ "(wp-login|wp-admin|preview=true)") ) {
unset beresp.http.set-cookie;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment