I want to do some work when the user first lands on my page (via a link or directly entering the URL). However, if the user goes off somewhere else and comes back to my page via back/forward buttons, I don’t want to do the work again.
What’s the best way to achieve this?
Note: The work should be done if the user hits the refresh button, forcing a page reload.
Combine this with localStorage I suppose.