Hacker News new | ask | show | jobs
by lewantmontreal 1290 days ago
How so people feel about client side navigation? Browsing svelte.dev it appears back/forward navigation now requires a request each time as browser cache is no longer usable.

Page refresh also seems to reset scroll position but that might be unrelated.

3 comments

Sveltekit saves your scroll position in session storage so refresh and back/forward navigation feels like regular browser behavior. If your scroll position is resetting on refresh that may be a bug.

Navigating back/forward will only make a new request if that page needs to fetch data in its +page.js component https://kit.svelte.dev/docs/load

This appears to be deliberate depending on the page. Looking at the network inspector as I click around, I see cache-control: private, no-cache on the responses for docs content, but I do see caching on the blog pages.
its just a setting now on sveltekit. clientside navigation is a single line of code