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

Is there a way to do cache busting by languageCode? #277

Open
mrsuau627 opened this issue Jul 21, 2023 · 0 comments
Open

Is there a way to do cache busting by languageCode? #277

mrsuau627 opened this issue Jul 21, 2023 · 0 comments

Comments

@mrsuau627
Copy link

We're in the process of converting a .NET Framework 4.7.2 Asp.NET application to .NET Core 6. In the .NET Framework app, we were using a language translation package by turquoiseowl that worked pretty well: https://github.com/turquoiseowl/i18n. We used the standard BundleConfig method of doing our package bundling and there were cases where the translations were done in the js file and then served up to the client. Because of this, with this older solution, we would append "?lang={languageCode}" to the bundle so that when a user switched languages, it would know it needed a different js bundle for that particular language, rather than grabbing the cached one.

For .NET Core, we're using a package very similar to this to do the translations. We're using WebOptimizer for js/css/html bundling and we'd like to do something similar. Right now, in order for cache busting to work, WebOptimizer generates a 'v={some long hash}" query param that it adds to each bundle so that it knows when it needs to refresh the cached bundles. Is there a way to add to this version or affect it in some way using the selected language tag? For example, a user is in spanish, generate a js bundle that looks like ?v=w8i38383je838d9jdf9df9ie&lang=es. Then an English user logs in, their bundle might be ?v=w8i38383je838d9jdf9df9ie&lang=en-us.

Thanks in advance

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

1 participant