Repository navigation
mod_cache_socache: Preserve the cached body across a 304 revalidation. - #1147
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
arturobernalg
force-pushed
the
fix/bz69512-socache-revalidate-body
branch
from
December 1, 2026 20:45
2e9b125 to
806cb05
Compare
store_headers() rebuilds the single socache blob (headers followed by body) in a fresh buffer every time the stored headers are updated. On a conditional revalidation the generic cache calls store_headers() and commits the entry without calling store_body() again, so the rebuilt blob held the new headers but no body, and commit_entity() stored a body-less entry. The next request recalled an empty body and served a truncated response. Carry the previously cached body, loaded by open_entity() into sobj->body, into the rebuilt buffer before commit_entity(), so the body survives a header-only update. This matches mod_cache_disk, where the body is kept in a separate file that revalidation leaves untouched. PR: 69512
arturobernalg
force-pushed
the
fix/bz69512-socache-revalidate-body
branch
from
December 1, 2026 20:50
806cb05 to
95f2083
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.
On a 304 refresh mod_cache_socache rewrote the cached entry with just the new headers and dropped the body, so the resource came back empty on the next hit — it keeps headers and body together in one socache blob, unlike mod_cache_disk whose body is a separate file. This carries the cached body across the header update in store_headers(), before the entry is committed, so a refresh no longer loses it. Reproduced on trunk with socache_shmcb, and a new test under test/modules/cache covers it. Bugzilla: https://bz.apache.org/bugzilla/show_bug.cgi?id=69512
APLOGNO()tag.changes-entries/*.txtfile is included.