Should updated warm the new build’s assets before the forced reload?
#16800
alexbjorlig
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When
kit.version.pollIntervaldetects a new deploy, the documented path is to force a full-page navigation (beforeNavigate+location.href, ordata-sveltekit-reload). That works, but the reload is a cold cache: every hashed/_app/immutable/*file is new, so the first load after deploy is slow.preloadCode/data-sveltekit-preload-codecan’t help here — they use the running client manifest, i.e. the old hashes.A small custom workaround: when
updated.currentbecomes true,fetchthe current URL withcache: 'reload', parse same-origin/_appmodulepreload/stylesheetlinks from the new HTML, and fetch those so the subsequent hard reload hits the HTTP cache.Questions:
saveData, racing the next navigation, etc.)?We already poll and hard-reload; this is only about making that reload cheaper for tabs that were open during the deploy. Closed tabs / first visits are unchanged.
All reactions