Skip to content

Add image disk cache + native-res hero upgrade + bootstrap-path timing

jedmund requested to merge jedmund/image-disk-cache into main

Created by: jedmund

Summary

Three stacked commits. Each is independently reviewable and self-contained.

  1. Add TTLDataCache for per-pipeline disk storage — wraps Nuke's DataCache with a TTL sidecar so .pixiv (14 d) and .pixivLightbox (7 d) entries expire by age on top of LRU-by-size. Each pipeline gets its own 3 GB directory so lightbox originals can't evict grid thumbnails.
  2. Upgrade detail hero to native resolution after lift settles — introduces HeroImageStack, a two-layer view that keeps the current .large base and crossfades a 1400 pt decode of .original on top ~400 ms after the matched-geometry entrance spring settles. Routes through .pixivLightbox so the preloadLightbox bytes are reused — one download per illust feeds both the hero upgrade (resized) and the lightbox (native). Bumps .pixivLightbox countLimit 6→25 to accommodate the mixed workload.
  3. Instrument image-cache bootstrap path with timing logs — diagnostic commit for the reported "several minutes to first feed" on a fresh install. Adds an image-cache OSLog category that times ImagePipeline.pixiv / .pixivLightbox static-let init (thread + total ms) and TTLDataCache.init phases (createDirectory, DataCache(path:), loadTimestamps) + timestamps count. Filter in Console.app with subsystem:com.attractor.pixillate category:image-cache.

Test plan

  • Fresh install on iPad Pro 13": open a detail with a large native source; hero visibly sharpens ~500 ms after the lift lands, lightbox still pinches to native
  • Tap a cell and dismiss within 200 ms: no .original request begins (upgrade task cancelled before firing)
  • Multi-page carousel: each page's .large shows instantly; upgrades fire only for pages the user rests on
  • Cold network + fresh install: capture Console logs under category:image-cache and confirm whether pipeline init is on main and how long each phase takes — this is what will tell us if the minutes-to-feed was TTLDataCache-related or pure network

🤖 Generated with Claude Code

Merge request reports

Loading