Releases: benshawuk/sparke
Releases · benshawuk/sparke
v1.1.0
What's new
data-revalidate— stale-while-revalidate freshness for preloaded pagesdata-preload—visibleandhoverpreload scopes- Alpine / Livewire — swap-time teardown and
wire:navigatedeference
CDN
<script
src="https://cdn.jsdelivr.net/gh/benshawuk/sparke@1.1.0/sparke.min.js"
defer
></script>jsDelivr may take a few minutes to pick up the new tag.
Sparke v1.0.1
Adds the preloading system and fixes an image-warming bug.
Added
- Whole-site crawl (
data-preload, defaultall): bounded breadth-first preloading of the same-origin site, so a small site is fully warm after the first paint.page= one hop,none= off. - Image preloading (
data-preload-images, defaultall): warms every<img>(incl. lazy + firstsrcsetcandidate) into the browser cache.offto disable. - LRU cache cap (
data-cache-size, default 100) and Save-Data back-off (auto images-off + one-hop on data-saver). Cache-Control: no-storepages are never cached.
Fixed
- Image warming is now concurrency-capped (max 4 in flight). The initial cut fired a request for every image on every crawled page at once, flooding and getting rate-limited by image hosts (e.g. a CDN) - which broke the very images it was warming. The cap protects both the host and the user's bandwidth on slow connections.
Install
<script src="https://cdn.jsdelivr.net/gh/benshawuk/sparke@1/sparke.min.js" defer></script>The @1 link auto-serves the latest 1.x patch. sparke.min.js is ~5 KB gzip.
Sparke v1.0.0
First public release of Sparke - make a multi-page website feel like an instant SPA.
A tiny, zero-dependency, progressive-enhancement script: it preloads same-origin links while the browser is idle and atomically swaps page content from memory on click. If JavaScript is unavailable, the browser just behaves as a normal MPA.
Install
<!-- self-hosted (recommended) -->
<script src="/js/sparke.min.js" defer></script>
<!-- or via CDN -->
<script src="https://cdn.jsdelivr.net/gh/benshawuk/sparke@v1.0.0/sparke.min.js" defer></script>sparke.min.js is ~4.4 KB gzip / ~3.8 KB brotli. See the README for full docs.
Highlights
- Preload + atomic swap (single
<main>or whole<body>) - GET-form interception, redirect handling, Back/Forward cache restore
- Opt-in View Transitions, zero-JS loading state, active-link highlighting
- Per-page head CSS sync, accessible focus + live-region announcements
- No build step, no config, no global - just one
<script>tag