Skip to content

fix: add proper cache control headers for all public endpoints#1863

Merged
netomi merged 3 commits into
mainfrom
support-caching-extension-json
May 22, 2026
Merged

fix: add proper cache control headers for all public endpoints#1863
netomi merged 3 commits into
mainfrom
support-caching-extension-json

Conversation

@netomi

@netomi netomi commented May 22, 2026

Copy link
Copy Markdown
Contributor

Previously, some endpoints did not include proper or inconsistent cache control headers.

This leads to the situation that responses can not be cached on the CDN level as it honors the cache control headers returned by the application.

This PR sets the cache control headers consistently for all public API endpoints:

  • set a consistent max-age for all endpoints which did not have it already
  • set max-age of 10m also for 404 responses and add mustRevalidate in such cases
  • the VSCode adapter api mostly just redirects to the regular api, add proper cache control there as well to let the CDN / reverse proxy properly cache the redirect to avoid duplicate requests

Currently for the majority of the endpoints we set 10min as max-age which is reasonable (changes will be reflected after max 10 min afaict), but this should be configurable.

@netomi
netomi requested a review from gnugomez May 22, 2026 07:06
Comment thread server/src/main/java/org/eclipse/openvsx/adapter/VSCodeAPI.java Fixed
Comment thread server/src/main/java/org/eclipse/openvsx/adapter/VSCodeAPI.java Fixed
Comment thread server/src/main/java/org/eclipse/openvsx/adapter/VSCodeAPI.java Dismissed
Comment thread server/src/main/java/org/eclipse/openvsx/adapter/VSCodeAPI.java Dismissed

@gnugomez gnugomez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why instead of setting them manually don't you add a global config in the SecurityConfig#filterChain?

@netomi

netomi commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

as we do not want the same cache control for all endpoints, they at least slightly differ. Till I have a better way to express that I just do it consistently for all endpoints, as some where omitted so far, and 404 did not have any.

@netomi
netomi merged commit 26a083b into main May 22, 2026
8 checks passed
@netomi
netomi deleted the support-caching-extension-json branch May 22, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants