Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Commit

Permalink
Add 29.5: Profiling Web Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 7, 2020
1 parent e80a688 commit 0345d88
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .symfony/config.vcl
@@ -1,3 +1,11 @@
acl profile {
# Authorize the local IP address (replace with the IP found above)
"a.b.c.d";
# Authorize Blackfire servers
"46.51.168.2";
"54.75.240.245";
}

sub vcl_recv {
set req.backend_hint = application.backend();
set req.http.Surrogate-Capability = "abc=ESI/1.0";
Expand All @@ -8,6 +16,16 @@ sub vcl_recv {
}
return (purge);
}

# Don't profile ESI requests
if (req.esi_level > 0) {
unset req.http.X-Blackfire-Query;
}

# Bypass Varnish when the profile request comes from a known IP
if (req.http.X-Blackfire-Query && client.ip ~ profile) {
return (pass);
}
}

sub vcl_backend_response {
Expand Down

0 comments on commit 0345d88

Please sign in to comment.