Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

O3-3347: SPA module should support appropriate caching headers #59

Merged
merged 7 commits into from
May 31, 2024

Conversation

ibacher
Copy link
Member

@ibacher ibacher commented May 30, 2024

While the ticket here is pretty narrow, this is a ground-up re-write of this module.

This rewrite drops the following features:

  • Proxying files from a remote location (there are much better ways of achieving this)
  • Serving the frontend from a URL other than <contextPath>/spa (we can look at adding this back in if anyone really needs it)

It adds the following features:

  • Appropriately sets cache headers so that importmap.json, routes.registry.json, and the single-page itself must be validated on every request. All other files are considered static and cached for 180 days.
  • Appropriate ETags are generated for all files, allowing less data to be sent over the wire if nothing has changed content-wise.
  • GZip compression is enabled for all files for user-agents that support it, again reducing the amount of traffic served over the wire.
  • Support for defining a custom frontend folder using runtime or system instead of a global property.

Implementation-wise, this relies heavily on Spring MVC's machinery to actually serve requests, so the previous servlet has been replaced with a controller. Additionally, the calls to get GP properties have been shifted into a GP listener. This means that we only need to update the spa.local.directory if someone actually changes the setting.

@ibacher ibacher requested a review from ojwanganto May 30, 2024 17:11
@mseaton mseaton requested a review from mogoodrich May 30, 2024 18:34
@ibacher ibacher merged commit 2c72797 into master May 31, 2024
4 checks passed
@ibacher ibacher deleted the O3-3347-spa-2.0 branch May 31, 2024 17:07
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