0

I have a ASP.NET MVC application in C# that uses i18 https://github.com/turquoiseowl/i18n for language translation.

This package lets you translate text that you have inside your javascript files. Everything works fine except that whenever I change the language and the site refreshes the javascript files don't get updated because the browser already have them cached so any translated string that you have in the javascript file will be in the default language when the site was first loaded.

I just added Bundle minification but that won't generate a new version every time you refresh the site.

What I need is that whenever the language is changed I have to force the server to send a new version of the javascript file so the browser replaces it with the current one.

Ideally would be to only tell the server that the browser needs new javascript files when the language was changed.

Any clue on how to solve this?

VAAA
  • 12,647
  • 20
  • 110
  • 213
  • Have you checked this post? It might be useful for your case: https://stackoverflow.com/questions/29517467/force-browser-to-refresh-javascript-code-while-developing-an-mvc-view – Dave Miller Nov 16 '20 at 08:08

0 Answers0