htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Normalise history cache key URLs, and prevent collisions in boosted anchors that use relative links.

Open croxton opened this issue 3 years ago • 0 comments

  1. Since LocalStorage is bound to the origin (domain/protocol/port triplet), we can normalize the URL format used as a key for a history snapshot to reduce cache misses for the same URL referenced differently. E.g.: https://mysite.com/about, /about and /about/ are normalized to /about.

  2. Prevent potential key collisions in boosted relative links, by converting the href to a fully resolved root-relative path. E.g. a boosted anchor shoe.html in the directory products becomes /products/shoe.html.

croxton avatar Oct 31 '22 12:10 croxton