From 9efd8e65ebce716d8d7397d423b304e10556afaa Mon Sep 17 00:00:00 2001 From: Colby Gutierrez-Kraybill Date: Wed, 29 Nov 2017 10:39:28 -0500 Subject: [PATCH] Add specific /projects cache handling when user is not logged-in --- bin/lib/fastly-config-methods.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/lib/fastly-config-methods.js b/bin/lib/fastly-config-methods.js index d84756262..9ba7c66dc 100644 --- a/bin/lib/fastly-config-methods.js +++ b/bin/lib/fastly-config-methods.js @@ -119,7 +119,9 @@ var FastlyConfigMethods = { ' set req.http.Fastly-Temp-XFF = req.http.X-Forwarded-For;\n' + ' }\n' + ' set req.grace = 60s;\n' + - ' return(pass);\n' + + ' if (!req.url ~ "^/projects/" && req.http.Cookie:scratchsessionid) {\n' + + ' return(pass);\n' + + ' }\n' + '}\n'; }, @@ -132,9 +134,11 @@ var FastlyConfigMethods = { setResponseTTL: function (condition) { return '' + 'if (' + condition + ') {\n' + - ' set beresp.ttl = 0s;\n' + - ' set beresp.grace = 0s;\n' + - ' return(pass);\n' + + ' if (!req.url ~ "^/projects/" && req.http.Cookie:scratchsessionid) {\n' + + ' set beresp.ttl = 0s;\n' + + ' set beresp.grace = 0s;\n' + + ' return(pass);\n' + + ' }\n'; '}\n'; } };