Hacker News new | ask | show | jobs
by danieltait 1186 days ago
Hmm yes ok I just removed the refresh now.

The reason it was there is some days I opened the tab on my iphone and for some reason it still showed the yesterdays result rather than the new day's letters.

Will have a think of a better way to force the refresh of the letters on a new day.

3 comments

> The reason it was there is some days I opened the tab on my iphone and for some reason it still showed the yesterdays result rather than the new day's letters.

This'll be the Cache-Control header interacting with tab resume: rather than setting that to expire after X time has elapsed, set it to expire at time=T, and the browser will¹ fetch the new page instead. You'd increase the effectiveness of this technique (and reduce your bandwidth requirements for repeat players) if you made `/daily` a static page, and factored out those JavaScript variables into a separate file, fetched with `fetch` or `XMLHttpRequest` (or even a `<script>` tag, like `wordlist.js` is).

If I've configured my browser to behave otherwise (e.g. it takes me longer than a day to solve each puzzle), I really don't want it overriding that and resetting on me: that would make me very sad.

¹: usually. Firefox Session Restore behaves differently – but that's expected behaviour. Every website ever behaves like that: it's what I expect, because I expect to be able to close my browser and open it again and still have more-or-less the same pages available. After all, I've got a refresh button, but no un-refresh button.

This is still happening btw - if I quickly switch to another tab it resets the board completely, giving me a different puzzle in practice mode. This makes it sadly unusable for me.
Sorry! I had only changed for the daily. Removed from practice and play now as well
setTimeout() with a timeout calculated to fire after midnight?