-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable htmx.config.historyEnabled does not disable history cache #3049
Comments
The doc states
which doesn't help much to understand the initial intent of this property, and issues #2587 and #2232 point out a similar issue (having to also set Looked at git blames, looks like this property has been there for quite some time, added in 2020 in 00e2249 I would personally say feel free to open a bugfix PR as it indeed doesn't sound very logical that disabling history doesn't really disable it |
It seems to me that this config value only currently disables the htmx code that calls the history api to push/replace state to up-date browsers history data. But it does not disable the htmx history feature feature code itself so with this set off you are left with a kind of half working htmx history feature. My best guess is that the ability to disable the history API was done for testing purposes as documentation shows as all the test suites have this config disabled even though they do in fact test and validate history functionality. So changing this config to be more logical and also force history cache size to 0 will likely mean trying to re-write all the history tests and possibly then finding the hard way why this config value was added originally. |
yeah, this was only for testing and obviously isn't complete maybe we should remove it from the docs entirely so people don't try to use it? |
I don't like the idea of removing it from the docs instead of implementing it properly, because this setting is useful if you want to disable the whole history feature and therefore URLs of boosted elements won't be pushed to the history. It wouldn't be that hard to fix it. |
I assumed that disabling
htmx.config.historyEnabled
would disable all history processing. However, this does not disable the creation of the history cache and the restoring of pages from the cache. To achieve this, you need to explicitly sethtmx.config.historyCacheSize = 0
. In my opinion, this makes no sense, or have I missed something?The text was updated successfully, but these errors were encountered: