mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxt): bypass browser cache when fetching app build id (#25813)
This commit is contained in:
parent
4fd4f95d48
commit
06352e350d
@ -14,7 +14,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
const currentManifest = await getAppManifest()
|
const currentManifest = await getAppManifest()
|
||||||
if (timeout) { clearTimeout(timeout) }
|
if (timeout) { clearTimeout(timeout) }
|
||||||
timeout = setTimeout(getLatestManifest, 1000 * 60 * 60)
|
timeout = setTimeout(getLatestManifest, 1000 * 60 * 60)
|
||||||
const meta = await $fetch<NuxtAppManifestMeta>(buildAssetsURL('builds/latest.json'))
|
const meta = await $fetch<NuxtAppManifestMeta>(buildAssetsURL('builds/latest.json') + `?${Date.now()}`)
|
||||||
if (meta.id !== currentManifest.id) {
|
if (meta.id !== currentManifest.id) {
|
||||||
// There is a newer build which we will let the user handle
|
// There is a newer build which we will let the user handle
|
||||||
nuxtApp.hooks.callHook('app:manifest:update', meta)
|
nuxtApp.hooks.callHook('app:manifest:update', meta)
|
||||||
|
Loading…
Reference in New Issue
Block a user