You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a cache miss occurs, htmx will fetch content from the server. If the server replies with an >=200 && <400 status, then htmx:historyCacheMissLoadError fires. This works as expected.
However when I shutdown my server and initiate a cache miss fetch, no events are triggered (I checked htmx.logAll()). When the server is shutdown and a request is made then htmx:sendError gets triggered. I am expecting some similar event during cache miss to be fired.
It seems loadHistoryFromServercreates a new XHR without the helper function issueAjaxRequest that adds a xhr.onerrorcallback.
Side note: the docs say htmx:historyCacheMissError not htmx:historyCacheMissLoadError`
The text was updated successfully, but these errors were encountered:
I think this is expected from the way this feature is setup right now which may not be ideal in all situations. The history restore function is currently not compatible with the issue ajax request method and implementing the 1000+ line of code for this edge case is not going to be easy. I recommend trying to set htmx.config.refreshOnHistoryMiss to true which avoids all the custom handling and lets the browser handle what actually should be a full page load normally. The only other option is to listen for htmx:historyCacheMiss and do a few second setTimeout to retry if the htmx:historyCacheMissLoad event doesn't fire
When a cache miss occurs, htmx will fetch content from the server. If the server replies with an >=200 && <400 status, then
htmx:historyCacheMissLoadError
fires. This works as expected.However when I shutdown my server and initiate a cache miss fetch, no events are triggered (I checked
htmx.logAll()
). When the server is shutdown and a request is made thenhtmx:sendError
gets triggered. I am expecting some similar event during cache miss to be fired.It seems
loadHistoryFromServer
creates a new XHR without the helper functionissueAjaxRequest
that adds axhr.onerror
callback.Side note: the docs say
htmx:historyCacheMissError
not htmx:historyCacheMissLoadError`The text was updated successfully, but these errors were encountered: