Skip to content

Instantly share code, notes, and snippets.

@adrienv1520
adrienv1520 / force-page-to-reload-from-server-at-browser-launch-javascript.md
Last active October 21, 2025 12:49
How to force a page to reload from server at browser launch with JavaScript

How to force a page to reload from server at browser launch with JavaScript

I spent weeks finding a way to refresh a page or a tab from the server once a user starts or restarts the browser. I was very surprised to find nothing about this topic.

Let's dig into the context, tries and the solution I came up with.

Context

Typically, once a user opens a browser and gets to a page, it directly provides the page in cache without refreshing any data from the server. Obviously, this only applies if the user is not in a private navigation.

In this case, as a user, I always need to open the browser and then manually reload the page to get the last updated data. What? Am I too lazy? Sure I am a developer!

@thunder-spb
thunder-spb / Ambilight test videos
Last active August 31, 2018 00:05
DIY Abmilight like system
Philips official:
https://www.youtube.com/watch?v=jV8IFZ5Sa_k
https://www.youtube.com/watch?v=2x3psK5pjME
20min demo video:
https://dl.dropboxusercontent.com/u/12487373/Dreambox/AtmoLight_Demo_All_In_One_HD.zip