htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Microsoft Edge ignoring `hx-history="false"`

Open 22ispencer opened this issue 1 year ago • 2 comments

I use Microsoft Edge at work and have been working on a new project using HTMX, I'm pretty new to it however when I attempted to use hx-history="false" to stop the page from caching an authorized page I noticed that the page was still being cached, because most users don't use Edge I tried this out in both Firefox and Chrome and found the site behaved as expected on these browsers. I know this is an edge case however the back button on the history doesn't seem to be firing a new HTTP request so my authentication middleware cannot prevent the page from loading.

22ispencer avatar Mar 29 '24 20:03 22ispencer

I have the same problem on a common page with chrome version 123.0.6312.86 and htmx version 1.9.10.

Lord-Y avatar Apr 02 '24 08:04 Lord-Y

Alright so for my purpose I added those response headers when returning the html code:

responseWriter.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
responseWriter.Header().Set("Pragma", "no-cache")
responseWriter.Header().Set("Expires", "0")

and it works.

Lord-Y avatar Apr 13 '24 17:04 Lord-Y