Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel config cache #131

Closed
Stijn-van-Nieulande opened this issue Mar 28, 2018 · 1 comment
Closed

Laravel config cache #131

Stijn-van-Nieulande opened this issue Mar 28, 2018 · 1 comment

Comments

@Stijn-van-Nieulande
Copy link

I'm working on fast performances for my site but the translation package won't enable it to serve translatable routes in route cache. It gives a 404 error because \UriLocalizer::localeFromRequest() won't work in route cache. I worked around this with setting a language hardcoded at that position but if I do that it gives me this error: http://prntscr.com/ixepwg I also worked around this error with replacing 'localize' to TranslationMiddleware::class but now the cache doesn't work properly anymore: http://prntscr.com/ixemvm
How can I fix this or is this a bugg in the translation package??

@sildraug
Copy link
Contributor

@Stijn-van-Nieulande It's not a bug. You can't use the route cache as far as I know since the number of languages is dynamic, and all of your route entries will be replicated for each new language you add to your DB.

If you have any ideas on how to implement this, they'd be welcomed.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants