I have a wen server running on an ESP32. It's all working really nicely, except for one minor problem. There is a control (switch) on the physical device the server is attached to. When one specific page of the website is active on a client, I need to disable that switch, as it gets over-ridden by an on-screen control in the clients browser. Disabling the switch always works perfectly, but re-enabling it does not.
There are two ways to exit the page in question: either click an on-screen "back" button, or hit the browsers back button. The onscreen button contains "onclick="window.location.href='/topmenu.html';", while the browsers back button does whatever it does. The on-screen back button always behaves perfectly, and the physical swich is re-enabled every time. However, clicking the browser back button changes pages, but the physical button is NOT re-enabled until I do a manual page refresh.
I track which page is active by setting a "currentPage" variable in the server. This variable gets set on the server.on handler for the html file for each web page. So, it appears to me the back button is causing a fill page re-load to occcur, while the browser back button appears to instead pull the page from its cache.
Is there a way to disable the browsers cache, so FORCE the page to re-load when the browser back button is used?