Add specific /projects cache handling when user is not logged-in

This commit is contained in:
Colby Gutierrez-Kraybill 2017-11-29 10:39:28 -05:00
parent 425f22735a
commit 9efd8e65eb

View file

@ -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';
}
};