Skip to content

Commit

Permalink
Merge pull request #191 from opensafely-core/immute-the-cache
Browse files Browse the repository at this point in the history
Add `immutable` to Cache-Control headers
  • Loading branch information
bloodearnest authored Mar 21, 2024
2 parents 1f3e848 + 5c4dc02 commit 6259c3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion airlock/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def headers(self):
return {
"ETag": self.etag,
"Last-Modified": self.last_modified,
"Cache-Control": f"max-age={self.MAX_AGE}",
"Cache-Control": f"max-age={self.MAX_AGE}, immutable",
}


Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_renderers_get_renderer_workspace(
assert response.headers["Content-Type"].split(";")[0] == mimetype
assert response.headers["Last-Modified"] == renderer.last_modified
assert response.headers["ETag"] == renderer.etag
assert response.headers["Cache-Control"] == "max-age=31536000"
assert response.headers["Cache-Control"] == "max-age=31536000, immutable"


@pytest.mark.parametrize("suffix,mimetype,template_path", RENDERER_TESTS)
Expand Down Expand Up @@ -80,4 +80,4 @@ def test_renderers_get_renderer_request(tmp_path, rf, suffix, mimetype, template
assert response.headers["Content-Type"].split(";")[0] == mimetype
assert response.headers["Last-Modified"] == renderer.last_modified
assert response.headers["ETag"] == renderer.etag
assert response.headers["Cache-Control"] == "max-age=31536000"
assert response.headers["Cache-Control"] == "max-age=31536000, immutable"

0 comments on commit 6259c3a

Please sign in to comment.