Cache logged out account-nav.json and session

Cache ^/fragment/account-nav.json and ^/session for logged out users
This commit is contained in:
Colby Gutierrez-Kraybill 2017-12-01 13:50:43 -05:00
parent fd6211bc6d
commit 0ba2693c0e
3 changed files with 6 additions and 3 deletions

View file

@ -93,7 +93,8 @@ var FastlyConfigMethods = {
setResponseTTL: function (condition) {
return '' +
'if (' + condition + ') {\n' +
' if (req.url ~ "^/projects/" && !req.http.Cookie:scratchsessionsid) {\n' +
' if (req.url ~ "^(/projects/|/fragment/account-nav.json|/session/)" && ' +
'!req.http.Cookie:scratchsessionsid) {\n' +
' set beresp.http.Vary = "Accept-Encoding, Accept-Language";\n' +
' unset beresp.http.set-cookie;\n' +
' return(deliver);\n' +