Repository navigation
CLARIN-DSpace v9/SSR static pages use the configured UI origin; SSR cache keyed by origin and language - #1718
Open
milanmajchrak wants to merge 2 commits into
Open
milanmajchrak wants to merge 2 commits into
milanmajchrak wants to merge 2 commits into
Conversation
…ache keyed by origin and language During SSR, HtmlContentService built the static-file URL from the request protocol and Host header. It now uses the origin of the configured ui.baseUrl, and the unused REQUEST injection is gone. The SSR page caches were keyed by path only, but an anonymous render also depends on the request origin and the dsLanguage cookie. The key moves to getSsrCacheKey (protocol, Host, language cookie, path) so it can be unit tested. The bot cache is read only for anonymous requests, like the anonymous cache. A static page name that contains a path separator once decoded loads nothing and renders the existing 404. Source: 60f6ccb Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
References
Description
During SSR, static HTML pages are loaded from the origin of
ui.baseUrl, not from the request Host. The SSR page caches are keyed by protocol, Host, language cookie and path.Instructions for Reviewers
List of changes in this PR:
HtmlContentService: on the server the URL starts with theui.baseUrlorigin. TheREQUESTinjection is gone.HtmlContentService: a file name that contains/or\after decoding loads nothing, so the existing 404 is shown.getSsrCacheKeyinssr-cache-key.util.ts, used by both caches inserver.ts.server.ts: the bot cache is read only for anonymous requests, like the anonymous cache. The/reloadcheck usesreq.url.How to test: the specs for
html-content.service,ssr-cache-key.util, the static page and the license agreement page pass locally (43). The three newhtml-content.servicespecs fail on the old code. ESLint is clean on the changed files. Not tested on a running SSR server.Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.🤖 Generated with Claude Code