flu
flu

Reputation: 14693

Symfony2 routing behaves different in prod environment

I can't figure this one out.

At first let me say that my cache is cleared. I went so far as to delete the prod and dev directories in app/cache. So this is no issue of non updated prod routes.

Here is my router:debug output:

Prod: app/console router:debug --env=prod:

[router] Current routes
Name            Method Pattern
instrumentlabel ANY    /backend/instrumentlabel/{page}/{filter}
marketmapping   ANY    /backend/marketmapping/{page}/{filter}

Dev: app/console router:debug --env=dev

[router] Current routes
Name            Method Pattern
instrumentlabel ANY    /backend/instrumentlabel/{page}/{filter}
marketmapping   ANY    /backend/marketmapping/{page}/{filter}

Both are the same (there's no distinction in my configuration).

Acessing /backend/instrumentlabel works in both environments. But when I try to access /backend/marketmapping it only works in the dev environment.

In the prod environment I'm always redirected to /backend/marketmapping/ (notice the leading slash) for no reason.

My prod.log simply states:

 request.ERROR: [...]: No route found for "GET /backend/marketmapping/"

Upvotes: 1

Views: 1131

Answers (1)

flu
flu

Reputation: 14693

As it turns out this was in fact a browser caching issue.

I realized that FireFox stated that /backend/marketmapping moved permanently (HTTP 301) to /backend/marketmapping/.

A week ago I had to alter the routing. Before that Symfony2 must have been responding to a request to /backend/marketmapping with a 301 to /backend/marketmapping/. My FireFox cached that information (but only in the prod environment, in dev this was a 302 which must not be cached by the browser).

I realized this after I checked the routes in Opera where everything worked fine.

To whom it may concern:

To force FireFox to forget cache redirects you can follow these directions:

http://forums.mozillazine.org/viewtopic.php?f=38&t=1995719


Its funny how most of your questions get answered by yourself right after you ask them.

Upvotes: 1

Related Questions