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

detectBrowserLanguage + Caching #3031

Open
2 of 4 tasks
warflash opened this issue Jul 16, 2024 · 0 comments
Open
2 of 4 tasks

detectBrowserLanguage + Caching #3031

warflash opened this issue Jul 16, 2024 · 0 comments

Comments

@warflash
Copy link
Contributor

warflash commented Jul 16, 2024

Describe the feature

In order to be able to cache responses from nuxt people basically all need to disable detectBrowerLanguage. This however makes it always default to the locale specified in nuxt config - even for recurring users.
I'd like to propse a middle ground:

  • No locale in URL + no i18n_selected cookie in request -> default locale
  • No locale in URL + i18n_selected value is set -> i18n_selected is returned as redirect url
  • Locale in URL + i18n_selected is set -> return 200
  • Locale in URL + no i18n_selected cookie in request -> return 200 and on client perhaps set i18n_selected

The important part is not returning a cookie from the server for cachability, but instead setting it on user interaction/navigation client side.

Hope that makese sense, if there's a way that's already possible then I'd love to know about it! Thanks!

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@warflash warflash changed the title Client Cookie Check for redirect detectBrowserLanguage + Caching Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant