3 ms·
If going between #0 and #1 works (which it obviously does), then that saves having to change the URL to something the browser considers a different page (I'm no
by Aaron2222 3y ago
If going between #0 and #1 works (which it obviously does), then that saves having to change the URL to something the browser considers a different page (I'm not a web dev, so not sure if there's a way of changing the URL to a different page without needing to do a page reload, but having only one page seems cleaner either way).
- benatkin 3y agoThat's what pushstate does, is change the URL without changing the page. I'm not sure if the browser never does any extra work or if it just mostly doesn't do any extra work at that time. If the user goes to the url again later on it won't have an entry in the cache though.