Skip to content

Commit

Permalink
chore: Add cache control header for static files (#35461)
Browse files Browse the repository at this point in the history
## Description
Add cache control header to static files in Caddy

Fixes #34643 

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10987267745>
> Commit: 779d12e
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10987267745&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Mon, 23 Sep 2024 04:38:28 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
dvj1988 authored Sep 23, 2024
1 parent 44f1486 commit eceaa43
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit eceaa43

Please sign in to comment.