Skip to content

[ESI] Explain requirements for Symfony to interopate with the gateway cache #14640

Closed
@Bilge

Description

@Bilge

The ESI docs claim:

if Symfony detects that it’s talking to a gateway cache that supports ESI, it generates an ESI include tag.

Without going into any specifics, we're led to believe that Symfony magically knows whether ESI is supported by the "gateway cache", e.g. Varnish. Both @stof and @derrabus specifically cited Varnish with reference to ESI, (even though the docs don't mention or endorse any specific gateway cache implementation), so let's use Varnish. However, even the latest version of Varnish (6.5 at time of writing) does not work with Symfony's magic gateway cache detection out of the box.

It seems to me this specific function determines whether or not ESI is supported, but Varnish does not emit a Surrogate-Capability header whatsoever by default. Presumably, then, the onus is on the developer to program Varnish to emit this header in an appropriate format to satisfy Symfony. It is not simply enough for the header to be present, it also has to be in a specific format, e.g. it must contain ESI/1.0. Being as that's the case, the docs need to be expanded to be absolutely clear about what is required from the gateway cache in order to be interoperable with Symfony's ESI implementation and not just leave it to magic because that leaves the developer without a lead on what to do in case the magic fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions