perf(api): optimize static asset caching, enable ETag support, and expand response compression mime types.#6273
Open
balazs-szucs wants to merge 5 commits intoStirling-Tools:mainfrom
Open
Conversation
…pand response compression mime types.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Spring MVC/static resource handling and response headers to implement a more explicit caching strategy for SPA assets and API responses, along with expanding server-side compression MIME types to improve repeat-visit performance.
Changes:
- Expanded
server.compression.mime-typesto include SVG and additional font MIME types. - Updated
ReactRoutingControllerto addCache-Control: no-cachebehavior when servingindex.html. - Reworked
WebMvcConfigstatic resource handlers to apply tiered cache policies (immutable for hashed assets, no-store for PWA metadata, etc.) and added a global API cache header inEndpointInterceptor.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| app/core/src/main/resources/application.properties | Expands compression MIME types for additional asset formats. |
| app/core/src/main/java/stirling/software/SPDF/controller/web/ReactRoutingController.java | Adds Cache-Control directives for SPA entry point responses. |
| app/core/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java | Introduces tiered cache policies for different static asset groups. |
| app/core/src/main/java/stirling/software/SPDF/config/EndpointInterceptor.java | Sets a default Cache-Control header for /api/** responses. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ConnorYoh
previously approved these changes
Apr 30, 2026
reecebrowne
previously approved these changes
Apr 30, 2026
11 tasks
# Conflicts: # app/core/src/main/java/stirling/software/SPDF/config/EndpointInterceptor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
This PR implements a caching strategy for Stirling-PDF assets and API endpoints. It aligns the backend with modern SPA best practices, ensuring maximum performance for repeat visitors while guaranteeing immediate invalidation upon new deployments.
Checklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyUI Changes (if applicable)
Testing (if applicable)
task checkto verify linters, typechecks, and tests pass