Skip to content

Commit

Permalink
ui: do not cache config.json and locale files (apache#10497)
Browse files Browse the repository at this point in the history
This will add a randomised timestamp when fetching config.json and
locale i18n files, to avoid using cached resources.

Fixes apache#9985

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
  • Loading branch information
rohityadavcloud authored Mar 5, 2025
1 parent 7f4e6a9 commit 80b5d5c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</div>
</body>
<script type="text/javascript">
fetch('./config.json')
fetch('./config.json?ts=' + Date.now())
.then(response => response.json())
.then(data => {
document.getElementById("favicon").setAttribute("href", data.loginFavicon);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function loadLanguageAsync (lang) {
return Promise.resolve(setLanguage(lang))
}

return fetch(`locales/${lang}.json`)
return fetch(`locales/${lang}.json?ts=${Date.now()}`)
.then(response => response.json())
.then(json => Promise.resolve(setLanguage(lang, json)))
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ vueApp.use(genericUtilPlugin)
vueApp.use(extensions)
vueApp.use(directives)

fetch('config.json').then(response => response.json()).then(config => {
fetch('config.json?ts=' + Date.now()).then(response => response.json()).then(config => {
vueProps.$config = config
let basUrl = config.apiBase
if (config.multipleServer) {
Expand Down

0 comments on commit 80b5d5c

Please # to comment.