From d1a69b845707acc4be34b3c988225dd685ec85e4 Mon Sep 17 00:00:00 2001 From: Diljit VJ Date: Fri, 27 Sep 2024 15:53:08 +0530 Subject: [PATCH] fix: Add cache control headers only for successful requests --- deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs index f265b2da71e..054c3de66bb 100644 --- a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs +++ b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs @@ -101,7 +101,15 @@ parts.push(` } header /static/* { - Cache-Control "public, max-age=31536000, immutable" + # Match the response with status 200 + @successful { + status 200 + } + + # Cache the response for 1 year if the response is successful + # @successful { + Cache-Control "public, max-age=31536000, immutable" + # } } request_body {