Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpKernel] [HttpCache] AbstractSurrogate doesn't treat 304 response as successful #43997

Closed
@aleho

Description

@aleho

Symfony version(s) affected

4.4+

Description

When HttpCache is allowed to preserve Last-Modified (see #42355) clients will execute subsequent requests with If-Modified-Since. If cache then returns a 304 Not Modified this will result in an exception.

This cycle will continue:

  • Request: initial
  • Response: sucessful, cache store, Last-Modified header
  • Request: with If-Modified-Since
  • Response: 500 (client drops cache), error page
  • Request: initial without timestamp
  • Response: sucessful

How to reproduce

Merge PR #42355 or check out https://github.com/aleho/symfony-httpcache for a minimal demo.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions