You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On any SvelteKit site with default link settings (all links have data-sveltekit-preload-data), hovering a link will prefetch that link's page's data and then clicking will navigate after all data has been fetched.
However, after clicking on a different link before the previous link has completed, the previous click's fetch will continue to run. This does not free up memory and network resources for the user as they wait for their desired page to load.
I think this can be addressed as a patch since cancelling unnecessary requests client-side will still complete their server-side load process to completion. If any applications depend on that behaviour, it shouldn't change.
Potentially out of scope is applying a similar 'abort' behaviour to goto and use:enhance for forms using <form method="GET">; though that's already solveable today in userland by providing wrappers.
Without asynchronous context in JS, I don't know how we'd know generally which asynchronous fetches were the result of the preload. At most, we'd be able to abort all of the fetches initiated synchronously as part of the preload. This might be enough - especially in +page.server.js situations, where there's only one fetch.
Describe the bug
On any SvelteKit site with default link settings (all links have
data-sveltekit-preload-data
), hovering a link will prefetch that link's page's data and then clicking will navigate after all data has been fetched.However, after clicking on a different link before the previous link has completed, the previous click's
fetch
will continue to run. This does not free up memory and network resources for the user as they wait for their desired page to load.Reproduction
Fetch/XHR
Logs
No response
System Info
Severity
annoyance
Additional Information
I think this can be addressed as a patch since cancelling unnecessary requests client-side will still complete their server-side
load
process to completion. If any applications depend on that behaviour, it shouldn't change.Potentially out of scope is applying a similar 'abort' behaviour to
goto
anduse:enhance
for forms using<form method="GET">
; though that's already solveable today in userland by providing wrappers.Potentially related to
The text was updated successfully, but these errors were encountered: