The Wayback Machine - https://web.archive.org/web/20250624164109/https://github.com/symfony/symfony/issues/47876
Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Symfony 5 - TraceableFirewallListener Ajax calls very slow #47876

Copy link
Copy link
Closed
@joangjermenitxt

Description

@joangjermenitxt
Issue body actions

Symfony version(s) affected

5.4

Description

I am working on a Symfony 5 project. The local setup runs in docker, while the live site is not in docker. The delay issue happens on both, locally and live site.

All the Ajax calls are very slow ~8 seconds each call. The backend logic is not complex and when I open Symfony Profiler, I see that delay happens because of TraceableFirewallListener

Screen Shot 2022-10-14 at 10 43 37 AM

This is the security.yaml firewall configuration:

security:
    enable_authenticator_manager: true
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            lazy: true
            provider: app_user_provider
            custom_authenticator: App\Security\AppCustomAuthenticator
            switch_user: true
            logout:
                path: app_logout
                target: /login

Any idea how to solve this? Please let me know if you need more information about this.

How to reproduce

Ajax Call:

$.ajax({
        url: generateRoute('api_define_template_encoding'),
        method: 'GET',
        data: {'type' : data.type},
        success: data => {
            $segments.text(data.segments)
            $encoding.text(data.encoding ?? '-')
        },
    })

Method controller:

public function defineTemplateEncoding(Request $request, SerializerInterface $serializer): JsonResponse
    {
        return new JsonResponse([
            'data'=> ['type' => 'main', 'encoding'=> 'GSM-7', 'segments' => 1],
            'json' => true],
        200
        );
    }

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.