Skip to content

[EventDispatcher] Different events for Master/Sub Requests #7467

@acasademont

Description

@acasademont

Although easier to manage, having the same events for Master and Sub requests means that a lot of listeners start with this line of code

if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
    return;
}

If listeners registered for which type of request have to be called we could improve performance and avoid enormous and useless log entries when you have multiple Sub Requests in your application (basically when using the render() function in Twig)

Current events could be left untouched in order to preserve BC but add new events that would only be called in Master or Sub Requests

All comments/opinions are welcome, would like to see if this is feasible before submitting a PR.

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