Commit a898b933 authored by Mounir Abid's avatar Mounir Abid Committed by Alexander Shumenko
Browse files

Issue #3216740 by mounir_abid: Use ESI only if the request has Surrogate-Capability = "abc=ESI/1.0"

parent 5a8582f9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -339,6 +339,11 @@ class CacheManager implements CacheManagerInterface, CacheTagsInvalidatorInterfa
      return FALSE;
    }

    // Verify if request has "ESI enabled" headers. Sometimes, you need to acces to your website without varnish.
    if ($this->request->headers->get('Surrogate-Capability') !== 'abc=ESI/1.0') {
      return FALSE;
    }

    $this->log(RfcLogLevel::DEBUG, 'ESI enabled for current request.');

    return TRUE;
+2 −0
Original line number Diff line number Diff line
@@ -150,6 +150,8 @@ sub vcl_recv {
    unset req.http.Cookie;
  }

  set req.http.Surrogate-Capability = "abc=ESI/1.0";

  return (hash);
}