Last active
August 22, 2016 18:52
-
-
Save russellsimpkins/d17da871948e6cec28613ff9cbb29c89 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub vcl_recv { | |
// remove jquery cache buster query parameter if it exists | |
if (req.url ~ "_=[0-9]+") { | |
set req.http.clean = regsuball(req.url, "(_=[0-9]+)", ""); | |
set req.http.clean = regsub(req.http.clean, "\?&", "?"); | |
set req.http.clean = regsub(req.http.clean, "&&", "&"); | |
set req.http.clean = regsub(req.http.clean, "&$", ""); | |
set req.http.clean = regsub(req.http.clean, "\?$", ""); | |
// modify the url with the clean version | |
set req.url = req.http.clean; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment