Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

return(pass) passes the request to the backend

By Cookie

/etc/varnish/default.vcl

Code Block
sub vcl_recv {
    if (req.http.Cookie ~ "LOGGED-IN=1") {
        return(pass)
    }
}

 

Image Removed
Info

bypasses cache if there is a LOGGED-IN cookie with value 1

 

By Header

/etc/varnish/default.vcl

Code Block
sub vcl_recv {
    if (req.http.X-Requested-With == "XMLHttpRequest") {
        return(pass)
    }
}

 

Image Removed
Info

ajax requests bypass cache

 

Caching strategies; you can set, and flush now for real world scenarios

Bomb proof static delivery: fullasagoog.com

...