Skip to content

Response uncacheable if there is an ESI fragment #25902

@leofeyer

Description

@leofeyer
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes
Symfony version 3.4

Prolog

The ResponseCacheStrategy::update() method makes all responses uncacheable if one of the embedded responses is not cacheable:

if (!$response->isFresh()) {
$this->cacheable = false;
}

Note that $this->cacheable is never set to true again.

Current behavior

This together with #18164 prevents the main response from being cached by the client if there is an embedded response. My web page is delivered with must-revalidate, no-cache, private although I have specified max-age: 1800.

Expected behavior

I would have expected the main response (the web page) to be cacheable by the client (max-age=1800, …). Is this the intended behavior or is it a bug?

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