Skip to content

[HttpKernel] Improve and add tests for Last-Modified computation with ESI responses #58011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mpdude
Copy link
Contributor

@mpdude mpdude commented Aug 14, 2024

Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Issues
License MIT

This PR slightly improves the test cases for #42355 (which fixed #41666).

It adds two tests for the cases where Last-Modified should not be added,
and updates the existing test to make it more obvious that we only look at
the existence of Last-Modified headers, whereas the ETag is not
relevant.

@carsonbot carsonbot added this to the 6.4 milestone Aug 14, 2024
@mpdude mpdude changed the title Improve and add tests for Last-Modified computation with ESI responses [HttpKernel] Improve and add tests for Last-Modified computation with ESI responses Aug 14, 2024
@mpdude
Copy link
Contributor Author

mpdude commented Aug 14, 2024

Inviting @aschempp as the author of #42355 for a review.

Background: I'm currently investigating a bug where ESI responses miss content. It might be that the change from #42355 – which I think is correct in itself 👍 – creates the condition where the bug appears.


// Embedded response uses "expiry" model
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "expiry" refers to the maxAge, but we're only using Last-Modified in both reqests. Last-Modified is, to my understanding, one possibly way of revalidation.

Copy link
Contributor

@aschempp aschempp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look good to me. I can't honestly tell why I added the Etag to the main response, since (as you said) this should not be relevant at all.

Background: I'm currently investigating a bug where ESI responses miss content. It might be that the change from #42355 – which I think is correct in itself 👍 – creates the condition where the bug appears.

Sounds like HttpCache returns a 304 response without content (which is according to specs), while trying to merge ESI fragments into the main response 🤔

@carsonbot carsonbot changed the title [HttpKernel] Improve and add tests for Last-Modified computation with ESI responses Improve and add tests for Last-Modified computation with ESI responses Aug 15, 2024
@mpdude
Copy link
Contributor Author

mpdude commented Aug 15, 2024

Sounds like HttpCache returns a 304 response without content (which is according to specs), while trying to merge ESI fragments into the main response 🤔

See #58015.

@carsonbot carsonbot changed the title Improve and add tests for Last-Modified computation with ESI responses [HttpKernel] Improve and add tests for Last-Modified computation with ESI responses Aug 15, 2024
@nicolas-grekas
Copy link
Member

Thank you @mpdude.

@nicolas-grekas nicolas-grekas merged commit b25a8d5 into symfony:6.4 Aug 16, 2024
10 checks passed
@mpdude mpdude deleted the amend-tests-for-esi-last-modified branch August 16, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants