News for hackers. Stuff that matters.
Re:Htmx 2.0.4 Released by recursivedoubts on Friday December 13, 2024 @10:42PM (#42414508)
i don't know how common it is or isn't, but it's reasonably common for htmx to be sprinkled into a regular MPA with full page navs, etc. and memory wouldn't survive that

no strong opinions on session vs local storage, i was trying to make htmx act as much like the browser as possible and the browser caches across tabs

you can disable history on any page by using the hx-history attribute and you can force a server request on every history navigation by setting the htmx.config.historyCacheSize config option to 0:

https://htmx.org/docs/#disabling-history-snapshots

https://htmx.org/docs/#htmx-security-tools

Re:Htmx 2.0.4 Released by benatkin on Friday December 13, 2024 @11:05PM (#42414590)
Memory would indeed be an issue for mixing MPA and SPA, but besides not being an issue for SPA it also wouldn't be an issue for sites that are all MPA except AJAX submissions that don't cause a SPA page change. Currently I think an all MPA would waste the localStorage space.

SessionStorage by default with prominent placement in the docs would be better I think. It would automatically clean up the data from visitors' disk space at appropriate times, whereas the localStorage setting puts it in a place that gets persisted for quite some time.

Thanks for those links, I've read them but it's good for others here to see them.