Ma77Ball opened a new pull request, #5846:
URL: https://github.com/apache/texera/pull/5846

   ### What changes were proposed in this PR?
   - Add StaticAssetCacheFilter, registered on /* in TexeraWebApplication, that 
sets Cache-Control on static frontend responses by request path.
   - index.html, the root, and Angular route paths get `no-cache, 
must-revalidate` so a stale entry document is never served past a deploy; 
content-hashed bundles (name.<hash>.js/.css and other fingerprinted assets) get 
`public, max-age=31536000, immutable`; /api/* responses are left untouched.
   - The Cache-Control decision lives in a pure 
StaticAssetCacheFilter.cacheControlFor(path) function so it is unit-testable 
without a servlet container.
   ### Any related issues, documentation, discussions?
   Closes: #5835
   ### How was this PR tested?
   - Run `sbt "WorkflowExecutionService/testOnly *StaticAssetCacheFilterSpec"` 
on JDK 17, expect 7 passing cases: hashed js/css/media to immutable, index.html 
and Angular routes to revalidate, /api/* untouched, and short numeric segments 
not mistaken for a content hash.
   - Manual: build the frontend, start dashboard-service, run `curl -I 
http://localhost:8080/index.html` and expect `Cache-Control: no-cache, 
must-revalidate`; `curl -I` a hashed bundle (e.g. /main.<hash>.js) and expect 
`Cache-Control: public, max-age=31536000, immutable`.
   - The servlet registration in TexeraWebApplication.run is covered by the 
manual curl steps, not the unit spec (the spec covers the header-decision 
logic).
   ### Was this PR authored or co-authored using generative AI tooling?
   Co-authored with Claude Opus 4.8 in compliance with ASF


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to