Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wish browsers did this as a default option. The back button should never have a noticeable delay.


They do if you use non-ajax navigation: the scroll position is preserved and so is the document as last seen: https://web.dev/bfcache/

But once you call history.pushState, the browser is relinquishing control to you. At that point, going “back” only changes the URL, as far as the browser is concerned, and that part is instantaneous.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: