diff --git a/schemes/config.py b/schemes/config.py index bb9f90e3..32452ca0 100644 --- a/schemes/config.py +++ b/schemes/config.py @@ -6,6 +6,7 @@ class Config: SESSION_COOKIE_SECURE = True SESSION_COOKIE_SAMESITE = "Lax" PERMANENT_SESSION_LIFETIME = timedelta(hours=1) + SEND_FILE_MAX_AGE_DEFAULT = timedelta(hours=1) # Flask-SQLAlchemy SQLALCHEMY_DATABASE_URI = "sqlite+pysqlite:///:memory:" diff --git a/tests/integration/test_http_caching.py b/tests/integration/test_http_caching.py index 14cbf6c7..e13de59b 100644 --- a/tests/integration/test_http_caching.py +++ b/tests/integration/test_http_caching.py @@ -6,3 +6,8 @@ def test_views_are_not_stored(self, client: FlaskClient) -> None: response = client.get("/") assert response.headers.get("Cache-Control") == "no-store" + + def test_static_resources_are_cached_publicly_for_one_hour(self, client: FlaskClient) -> None: + response = client.get("/static/application.min.css") + + assert response.headers.get("Cache-Control") == "public, max-age=3600"