Closed bluz71 closed 1 month ago
Hey! Thanks for being so thorough with your issue.
I'm definitely considering adding support for preloading, I keep waffling on it though because the Instant.page library already does a great job of covering this feature. The code base is focused and small, and the author seems to do a good job of staying on top of preloading best practices.
Hello @imacrayon,
See this comment in #99.
@imacrayon,
The speculationrules
API works in Chrome to preload links on hover.
I just added this to my app's layout:
<script type="speculationrules">
{
"prerender": [{
"source": "document",
"where": {
"href_matches": "/*"
},
"eagerness": "moderate"
}]
}
</script>
Details are provided here.
Note, this does not work in Brave browser as noted here.
Safari and Firefox, not yet, but I do envisage this eventually being done.
I suggest do nothing, let browsers worry about preloading.
Best regards.
Hello Alpine AJAX,
Following on from #99, SPA navigation via
hx-boost
is deliberately not provided by Alpine AJAX due to browser improvements and View Transistions which I am now convinced is a reasonable position to take.However, would it be possible for Alpine AJAX to provide a link preloading mechanism to make page to page navigation even speedier? Something like:
HTMX provides preloading on either
mousedown
ormouseover
events, defaulting tomousedown
. I think this is a very sensible default and to be honest is just about all this is required sincemouseover
could end up in disaster (too many requests, many not necessary).The Alpine AJAX library author posted this on X:
Speculative Loading whilst interesting does not seem as immediately useful is
mousedown
Link preloading.I would be interested to know what position Alpine AJAX takes on this.
Best regards.