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.