Hacker News new | past | comments | ask | show | jobs | submit login

It might be to force a refresh of the favicon? Never tried rendering 10 frames per second to it, but have definitely seen cached icons when devving locally.



That part is clear to me. What isn't clear is if they could get the same effect by using pushState to go from /0 to /1 rather than #0 and #1

Of course, since there's only 2 pages it switches between, they could create those pages on GitHub pages even though it doesn't support a catch-all route like surge.sh, firebase hosting, vercel, netlify, etc. allow on otherwise static sites.


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).


That'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.




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

Search: