Skip to content

Commit 80b5d5c

Browse files
ui: do not cache config.json and locale files (#10497)
This will add a randomised timestamp when fetching config.json and locale i18n files, to avoid using cached resources. Fixes #9985 Signed-off-by: Rohit Yadav <[email protected]>
1 parent 7f4e6a9 commit 80b5d5c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ui/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</div>
5656
</body>
5757
<script type="text/javascript">
58-
fetch('./config.json')
58+
fetch('./config.json?ts=' + Date.now())
5959
.then(response => response.json())
6060
.then(data => {
6161
document.getElementById("favicon").setAttribute("href", data.loginFavicon);

ui/src/locales/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function loadLanguageAsync (lang) {
3939
return Promise.resolve(setLanguage(lang))
4040
}
4141

42-
return fetch(`locales/${lang}.json`)
42+
return fetch(`locales/${lang}.json?ts=${Date.now()}`)
4343
.then(response => response.json())
4444
.then(json => Promise.resolve(setLanguage(lang, json)))
4545
}

ui/src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ vueApp.use(genericUtilPlugin)
5454
vueApp.use(extensions)
5555
vueApp.use(directives)
5656

57-
fetch('config.json').then(response => response.json()).then(config => {
57+
fetch('config.json?ts=' + Date.now()).then(response => response.json()).then(config => {
5858
vueProps.$config = config
5959
let basUrl = config.apiBase
6060
if (config.multipleServer) {

0 commit comments

Comments
 (0)