mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-29 18:46:20 -05:00
Add specific /projects cache handling when user is not logged-in
This commit is contained in:
parent
425f22735a
commit
9efd8e65eb
1 changed files with 8 additions and 4 deletions
|
@ -119,7 +119,9 @@ var FastlyConfigMethods = {
|
||||||
' set req.http.Fastly-Temp-XFF = req.http.X-Forwarded-For;\n' +
|
' set req.http.Fastly-Temp-XFF = req.http.X-Forwarded-For;\n' +
|
||||||
' }\n' +
|
' }\n' +
|
||||||
' set req.grace = 60s;\n' +
|
' set req.grace = 60s;\n' +
|
||||||
' return(pass);\n' +
|
' if (!req.url ~ "^/projects/" && req.http.Cookie:scratchsessionid) {\n' +
|
||||||
|
' return(pass);\n' +
|
||||||
|
' }\n' +
|
||||||
'}\n';
|
'}\n';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -132,9 +134,11 @@ var FastlyConfigMethods = {
|
||||||
setResponseTTL: function (condition) {
|
setResponseTTL: function (condition) {
|
||||||
return '' +
|
return '' +
|
||||||
'if (' + condition + ') {\n' +
|
'if (' + condition + ') {\n' +
|
||||||
' set beresp.ttl = 0s;\n' +
|
' if (!req.url ~ "^/projects/" && req.http.Cookie:scratchsessionid) {\n' +
|
||||||
' set beresp.grace = 0s;\n' +
|
' set beresp.ttl = 0s;\n' +
|
||||||
' return(pass);\n' +
|
' set beresp.grace = 0s;\n' +
|
||||||
|
' return(pass);\n' +
|
||||||
|
' }\n';
|
||||||
'}\n';
|
'}\n';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue