From f1b19ebae3ae01d25b77fe1ac1e8c624a49c8b17 Mon Sep 17 00:00:00 2001 From: Athou Date: Mon, 26 Aug 2024 11:39:58 +0200 Subject: [PATCH] after reading the spec, what we want is actually "no-cache" that actually means "cache but revalidate immediately" using If-Modified-Since request headers and 304 response codes --- commafeed-server/src/main/resources/application.properties | 4 ++-- .../test/java/com/commafeed/integration/StaticFilesIT.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commafeed-server/src/main/resources/application.properties b/commafeed-server/src/main/resources/application.properties index 1ca5fad9..148c37bd 100644 --- a/commafeed-server/src/main/resources/application.properties +++ b/commafeed-server/src/main/resources/application.properties @@ -4,10 +4,10 @@ quarkus.http.test-port=8085 # static files ## make sure the webapp is always up to date -quarkus.http.filter.index-html.header."Cache-Control"=no-cache, no-store, must-revalidate +quarkus.http.filter.index-html.header."Cache-Control"=no-cache quarkus.http.filter.index-html.matches=/ ## make sure the openapi documentation is always up to date -quarkus.http.filter.openapi.header."Cache-Control"=no-cache, no-store, must-revalidate +quarkus.http.filter.openapi.header."Cache-Control"=no-cache quarkus.http.filter.openapi.matches=/openapi[.](json|yaml) # security diff --git a/commafeed-server/src/test/java/com/commafeed/integration/StaticFilesIT.java b/commafeed-server/src/test/java/com/commafeed/integration/StaticFilesIT.java index b16495ec..e616f5a7 100644 --- a/commafeed-server/src/test/java/com/commafeed/integration/StaticFilesIT.java +++ b/commafeed-server/src/test/java/com/commafeed/integration/StaticFilesIT.java @@ -12,7 +12,7 @@ class StaticFilesIT { @ParameterizedTest @ValueSource(strings = { "/", "/openapi.json", "/openapi.yaml" }) void servedWithoutCache(String path) { - RestAssured.given().when().get(path).then().statusCode(200).header("Cache-Control", "no-cache, no-store, must-revalidate"); + RestAssured.given().when().get(path).then().statusCode(200).header("Cache-Control", "no-cache"); } @ParameterizedTest