Repository navigation
Conversation
…atic 404 (dspace-customers#1087)
vidiecan
force-pushed
the
fix/issue-1087-fast-404-tul
branch
from
October 22, 2026 10:35
cedd656 to
78b0e0d
Compare
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
/handle/15240/<n>/pt-br.html/en.html/..., 120 junk URLs per item, ~1,700 req/s). Every request was a full SSR with about 19 REST requests, each holding a database connection, until Postgres ran out of connections.Description
One check in
server.ts, before the SSR: for/handle/<prefix>/<anything>and/id/<type>/<id>it makes the one REST requestLookupGuardwould make first (pid/find, ordso/findfor/id/uuid/<uuid>).index.html, 9.8 KB, the same file as the existing CSR fallback),Cache-Control: no-store, no ETag/ranges. The browser renders the usual "not found" page from it.Handle suffixes are never judged from the path, only the REST API decides. Paths that Angular's router could read differently than a plain path (
;,=,(),%, empty segments) are not checked and render as before. The check is skipped when SSR (universal.preboot) is off.The specific junk patterns of this crawler stay in the nginx config (#1087), together with the rate limits for
/handle/and/server/api/pid/find, which the bot also calls directly.Measurements
Production build, SSR against the TUL REST API (read-only proxy); CPU = Node process CPU time per request:
/handle/15240/5308/pt-br.html/x(handle not found)/id/handle/15240/5308/junk,/id/uuid/<missing uuid>/handle/15240/5308,/handle/15240/5308/,/handle/15240/5308;a=b/handle/15240/nope=(not checked, see above)/items/<existing uuid>/foo/bar,/items/<missing uuid>Instructions for Reviewers
cedd656be7.=and;paths are not checked (Angular reads/handle/1/2=xas handle1/2); the 404 must not be cacheable or rangeable; a deadline over the whole probe.Tests
pid/findrenders the page as before; with a REST API that never answers, the probe gives up after 3 s and the render starts, as before.test:headlessgreen,lintonserver.tsclean except the pre-existing unusedexistsSync,build:prodOK.