From eceaa43ebae1c8db59e34d0a08e568b3c85e38e2 Mon Sep 17 00:00:00 2001 From: Diljit Date: Mon, 23 Sep 2024 12:45:13 +0530 Subject: [PATCH] chore: Add cache control header for static files (#35461) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Add cache control header to static files in Caddy Fixes #34643 ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 779d12e84054412d436e8a0c0f26878e475d7469 > Cypress dashboard. > Tags: `@tag.All` > Spec: >
Mon, 23 Sep 2024 04:38:28 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced caching strategy for static assets, improving performance and reducing load times. - Introduced a `Cache-Control` header for static files to optimize browser caching. - Updated caching configuration to allow more frequent updates of JavaScript and CSS files. --- deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs index 4d644c5d41..b5103011c4 100644 --- a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs +++ b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs @@ -92,6 +92,10 @@ parts.push(` X-Appsmith-Request-Id {http.request.uuid} } + header /static/* { + Cache-Control "public, max-age=31536000, immutable" + } + request_body { max_size ${process.env.APPSMITH_CODEC_SIZE || 150}MB }