Improve Headers For Browser Caching - #283
Merged
Merged
Conversation
thehabes
marked this pull request as ready for review
July 28, 2026 17:55
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.
Supports CenterForDigitalHumanities/glossing-entries#323.
Problem
GET /gog/id/:_idreturns an entity with its targeting Annotations merged in, but setsLast-Modifiedfrommatch— the raw document fromfindOne, captured beforeexpand()runs:configureLastModifiedHeader(utils.js:222-241) derives the date from__rerum.isOverwrittenor__rerum.createdAt. Both describe the root entity only. The merged Annotations are never in scope for that header.The result is a header that does not move when a targeting Annotation is added, changed, or removed — a wrong freshness signal for the composed body. Confirmed empirically: adding an Annotation changed the body and the ETag, and left
Last-Modifieduntouched.Related
Pairs with CenterForDigitalHumanities/glossing-entries#324, which stops the GoG client reading form-prefill data through the browser cache. Neither PR depends on the other; this one removes a latent trap for future clients and intermediaries.