8000 Too many Routes ? · Issue #16343 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}
Too many Routes ? #16343
Closed
Closed
@AntoineLemaire

Description

@AntoineLemaire

Is there a limit with the number of routes we can create ?

My application is using JMSI18nRoutingBundle, and we have more than 30 locales.

JMS create in app/cache/prod/appProdUrlGenerator.php all routes for each locales in $declaredRoutes

I opened a ticket an issue on JMSI18nRoutingBundle (link), but it seems the issue is the same in symfony without JMSI18nRoutingBundle.

I just try to create a basic project, with 20 controllers, and foreach of them, on function with 2000 routes.

    /**
     * @Route("/1", name="homepage1")
     * @Route("/2", name="homepage2")
     * @Route("/3", name="homepage3")
    [...]
     * @Route("/2000", name="homepage2000")
     */
    public function indexAction(Request $request)
    {
        echo $this->generateUrl('homepage1');
        exit;
    }

When number of routes approaches 32 760, echo $this->generateUrl('homepage1'); is failing :

Unable to generate a URL for the named route "homepage1" as such route does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0