Skip to content

Commit 7a803d4

Browse files
feat: implement version-based cache busting for i18next translations
1 parent fd6e927 commit 7a803d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/loader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ if (typeof requirejs !== "undefined") {
6363
});
6464
}
6565

66+
const APP_VERSION = "3.4.1";
67+
6668
async function initializeI18next() {
6769
return new Promise((resolve, reject) => {
6870
i18next.use(i18nextHttpBackend).init(
@@ -75,9 +77,7 @@ if (typeof requirejs !== "undefined") {
7577
escapeValue: false
7678
},
7779
backend: {
78-
// REMOVED: Date.now() cache buster.
79-
// Using a static version or relying on browser cache is better for performance.
80-
loadPath: "locales/{{lng}}.json"
80+
loadPath: "locales/{{lng}}.json?v=" + APP_VERSION
8181
}
8282
},
8383
function (err, t) {

0 commit comments

Comments
 (0)