PD-6059: Serve public record page from orcid-web with Last-Modified / If-Modified-Since (304) - #7648
Open
cryptalith wants to merge 1 commit into
Open
PD-6059: Serve public record page from orcid-web with Last-Modified / If-Modified-Since (304)#7648cryptalith wants to merge 1 commit into
cryptalith wants to merge 1 commit into
Conversation
…-Modified-Since (304) The public record page HTML was served statically from the orcid-web-frontend war, so no per-record Last-Modified was possible. publicPreview now serves the Angular shell itself: it sends Last-Modified from the record last_modified, answers fresh If-Modified-Since with 304 (Spring checkNotModified), and sets Cache-Control: no-cache. The shell is fetched from the co-deployed frontend war by the new StaticShellService (per-locale TTL cache, stale-on-error). No ETag is emitted since Cloudflare has been observed stripping it. The /print path is unchanged. orcid-web-proxy nginx now routes record pages to orcid-web and stops forcing no-store.
Member
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.
Summary
Implements PD-6059: the public record page (
orcid.org/{orcid-id}) now sends aLast-Modifiedheader equal to the record'slast_modifiedand answersIf-Modified-Sincewith304 Not Modified, so search crawlers can revalidate cheaply (SEO).Why this shape
In production the record-page HTML is served statically from the
orcid-web-frontendwar (Tomcat DefaultServlet), so no per-recordLast-Modifiedwas possible there. This PR makesPublicProfileController.publicPreviewserve the Angular shell itself:StaticShellServicefetchesindex.htmlfrom the co-deployedorcid-web-frontendwar (per-locale, TTL cache, serves stale on fetch failure). Locale comes from thelocale_v3cookie viaLocaleManager, mirroring the nginxlangCodemap.publicPreviewnon-print branch:Cache-Control: no-cache, then SpringServletWebRequest.checkNotModified(lastModified)(handles IMS parsing, second truncation, HEAD, 304), else writes the shell.no-store)./printpath unchanged. 404/lowercase-x redirects unchanged.orcid-web-proxynginx: record-page location routes to/orcid-weband stops forcingno-store.New properties (defaults suit local dev):
org.orcid.frontend.web.frontendShellBaseUri,org.orcid.frontend.web.frontendShellCacheTtlMinutes.Testing
PublicProfileControllerTest(12 tests, all passing): 200 with RFC-1123Last-Modified/no-cache/no ETag, 304 on equal/future IMS (incl. ms-truncation), 200 on stale/malformed IMS, HEAD handling, locked/deprecated records, 404 redirect, /print unchanged.StaticShellServiceTest(5 tests): locale mapping, TTL cache, stale-on-error, failure without cache.Rollout
Deploy this first — it is inert until nginx routes record-page HTML to orcid-web. The per-env nginx/property changes go out as separate orcid-ansible_inventory-private PRs (QA → SBOX → PROD). Rollback is a one-line nginx revert.
Follow-ups: same treatment for
/{orcid}/summaryand/{orcid}/print, Cypress e2e spec.