mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-16 16:19:48 -05:00
Cache ^/projects/ to users who are not logged-in
This commit is contained in:
parent
9efd8e65eb
commit
7a6be0306b
1 changed files with 6 additions and 2 deletions
|
@ -119,7 +119,9 @@ var FastlyConfigMethods = {
|
|||
' set req.http.Fastly-Temp-XFF = req.http.X-Forwarded-For;\n' +
|
||||
' }\n' +
|
||||
' set req.grace = 60s;\n' +
|
||||
' if (!req.url ~ "^/projects/" && req.http.Cookie:scratchsessionid) {\n' +
|
||||
' if (req.url ~ "^/projects/" && !req.http.Cookie:scratchsessionid) {\n' +
|
||||
' set req.http.Cookie = req.http.Cookie:scratchlanguage;\n' +
|
||||
' } else {\n' +
|
||||
' return(pass);\n' +
|
||||
' }\n' +
|
||||
'}\n';
|
||||
|
@ -134,7 +136,9 @@ var FastlyConfigMethods = {
|
|||
setResponseTTL: function (condition) {
|
||||
return '' +
|
||||
'if (' + condition + ') {\n' +
|
||||
' if (!req.url ~ "^/projects/" && req.http.Cookie:scratchsessionid) {\n' +
|
||||
' if (req.url ~ "^/projects/" && !req.http.Cookie:scratchsessionid) {\n' +
|
||||
' set beresp.http.Vary = "Accept-Encoding, Accept-Language";\n' +
|
||||
' } else {\n' +
|
||||
' set beresp.ttl = 0s;\n' +
|
||||
' set beresp.grace = 0s;\n' +
|
||||
' return(pass);\n' +
|
||||
|
|
Loading…
Reference in a new issue