8 ms·
Last year chrome started discarding background tabs to save memory, probably should have said discard rather then sleep it's been a while since I worked on that
by ledgerdev 3y ago
Last year chrome started discarding background tabs to save memory, probably should have said discard rather then sleep it's been a while since I worked on that. Our user base keeps tabs in background often in mobile devices and we saw some reports of it. https://arstechnica.com/gadgets/2023/02/chrome-110-will-automatically-discard-background-tabs-heres-how-to-stop-it/ https://arstechnica.com/gadgets/2023/02/chrome-110-will-auto...
When you do an htmx navigation to a new page, a discarded tab will "restore" only the last htmx fragment loaded, not the entire html page with style tags. Fix is to use unique url on push that isn't in local cache which forces a server reload on tab wake from discard.
- wmanley 3y agoTry adding the response header: Vary: HX-Request
- recursivedoubts 3y agoYep, probably browser caching: https://htmx.org/docs/#caching https://htmx.org/docs/#caching
- ledgerdev 3y agoNext time I work on it, will try to see if that resolves it.
- yawaramin 3y agoThat worked for me. Thank you.