Skip to content
Permalink
Browse files

Purge amp pages when main page is purged, as well

  • Loading branch information
FlorianSW committed Nov 27, 2019
1 parent c13c894 commit 7d1ece0f9ac2c9018ebb9e634ab4955990cbb627
Showing with 14 additions and 0 deletions.
  1. +14 −0 modules/role/templates/varnish/default.vcl.erb
@@ -99,6 +99,20 @@ sub vcl_pipe {
}

sub vcl_purge {
if (req.url !~ "(\?|&)(action=amp)") {
set req.http.X-Original = req.url;
if (req.url ~ "&") {
set req.url = req.url + "&action=amp";
} else {
set req.url = req.url + "?action=amp";
}
return (restart);
}

if (req.http.X-Original) {
set req.url = req.http.X-Original;
}

if (!req.http.x-wap) {
set req.http.x-wap = "no";
return (restart);

0 comments on commit 7d1ece0

Please sign in to comment.
You can’t perform that action at this time.