Skip to content

Commit

Permalink
Merge pull request #130 from alphagov/add-server-timing-cache-header
Browse files Browse the repository at this point in the history
Add cache state to Server-Timing header
  • Loading branch information
richardTowers authored Jan 10, 2025
2 parents bde0ee3 + 085eea9 commit 88141ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions www/www.vcl.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,12 @@ sub vcl_miss {
sub vcl_deliver {
set resp.http.Strict-Transport-Security = "max-age=31536000; preload";

if (fastly_info.state ~ "^HIT") {
set resp.http.Server-Timing:cacheHit = "";
} else if (fastly_info.state ~ "^MISS") {
set resp.http.Server-Timing:cacheMiss = "";
}

# GOV.UK accounts
if (resp.http.GOVUK-Account-End-Session) {
add resp.http.Set-Cookie = "__Host-govuk_account_session=; secure; httponly; samesite=lax; path=/; max-age=0";
Expand Down

0 comments on commit 88141ba

Please sign in to comment.