Additionally set expires header when caching responses

Browsers are rather smart, but also dumb. This uses the `Expires` header
alongside `cache-control` to better prompt the browser to actually
cache.

Unfortunately, firefox still tries to "race" its own cache, in an
attempt to respond to requests faster, so still ends up making a bunch
of requests which could have been cached. Doesn't appear there's any way
around this.
This commit is contained in:
Jake Howard
2021-12-28 16:24:42 +00:00
parent cc646b1519
commit 4584cfe3c1
5 changed files with 75 additions and 40 deletions

View File

@@ -80,6 +80,7 @@ uuid = { version = "0.8.2", features = ["v4"] }
chrono = { version = "0.4.19", features = ["serde"] }
chrono-tz = "0.6.1"
time = "0.2.27"
httpdate = "1.0"
# Job scheduler
job_scheduler = "1.2.1"