Preload strategies using WKWebView
summary
Shows a concrete preload implementation for WKWebView that cuts 90th‑percentile webview load from ~6s to ~3s by using a head-only preload.html with multiple link rel="preload" entries and an offscreen WKWebView created on the main actor to populate WKWebsiteDataStore so later webviews hit cache rather than network. Notes URLSession cache is incompatible, Safari lacks prefetch, WKURLSchemeHandler can serve local files but not http/https and has a ~100 resource note, and recommends preloading only focused assets to avoid bloating startup. WKWebsiteDataStore link rel="preload" offscreen WKWebView preloader WKURLSchemeHandler
AI-written summary · about
chapters (18)
- 0:00Introduction
- 2:32Current approaches
- 3:14WKWebView
- 6:50Performance is a pain
- 7:04How to measure performance
- 7:41Web Performance Journey
- 9:09WKWebView Data Management
- 12:05Example
- 12:28Scenarios
- 14:24Link tag
- 15:33First scenario
- 16:11Demo
- 16:55When
- 17:12Demonstration
- 17:52Nonweb context
- 18:36Public function
- 19:12Preload HTML
- 24:39Conclusions
related talks
21mPreload Strategies: Step in Time, Step in Time!
27mpreconnect, prefetch, preload, pre what? An intro to Resource Hints
28mBetter than loading fast… is loading instantly
28mThe Browser Hackers Guide To Instantly Loading Everything
31mBe lazy, but with strategy
23mA pragmatic approach to WebViews
14mMaking the Web Instant
40mpreconnect, prefetch, preload, pre-what?
