I have a simple latency problem which I think should be solvable, but I am running out of ideas. Any help will be much appreciated.
I have a page that never changes, it is hosted in the US, but many customers are in Japan and the latency is horrible.
The problem is that the Javascript code in the page needs an ID passed from the source. So, we put the id in a query parameter, and that works, but it busts the cache and the latency is horrible. It should be cached locally. The id is a random primary key which is not predictable, but the actual page never changes.
Hence, the issue is that the page is never cached by the browser, though the content never changes. I can see that the browser only sees a different url and bypasses the cache, but nowadays that we do single page apps and fancy javascript I think I should have more control on this. Either way, I can't seem to find an acceptable solution.
We tried using openWindow() and passing the id later, but openWindow does not work reliably, as many browsers block the pop-up. We also tried with a minimal page that references the big Javascript as a library, but that still requires a hop over the Pacific. I have access to Could front, and it has some configs to ignore query parameters, but the value of the parameters need to be known beforehand.... etc. etc. .
..I'm stuck. Please help.
You can use a hash:
https://www.mypage.com#123456789
The hash is not transmitted to the server and stays on the browser's side. You can than read it in JS with:
window.location.hash