v149 · developer trial · javascript
Inline script cache
Chrome's V8 bytecode cache, which already exists for <script src>, now also covers inline <script> blocks. Cache entries are keyed by SHA-256 of the script body plus the document's network isolation key, so repeat visits don't recompile the same inline snippet.
concepts
-
Cold vs Warm
Loads two pages containing identical large inline scripts. First load is a cold compile; subsequent loads should hit the bytecode cache. Reports approximate compile time via
PerformanceObservercompile-marks. -
Cache Key Probe
An editable script and a live SHA-256 readout. Change one character, hit Load, and the run is logged as a cache miss; repeat the same body and subsequent runs are hits. Shows exactly how content-hash keying behaves.
-
Cache Impact Analyzer
Paste any inline script, hit "Analyze", and see estimated cold vs. warm compile times, calculated savings percentage, and a checklist of cache-eligibility rules — size threshold, no dynamic code, stable content.
-
Size Threshold Explorer
Paste a script and see whether it falls inside V8's cacheable size window. Six presets from tiny (40 B) to analytics (4 KB) show how size affects eligibility. An eligibility checklist catches
eval(),new Function(),document.write(), andwith()— each of which disqualifies a script from caching regardless of size. -
Bytecode Savings Calculator
Enter script size, daily page loads, and repeat-visitor rate to estimate how much parse and compile time Chrome 149's inline script cache saves across your users. Device speed presets model fast desktop, mid-range mobile, and budget Android. A timeline bar compares cold vs warm compile time visually.
-
Module vs Classic Script Cache
Compare the caching model for
<script type="module">vs classic<script>. Classic scripts cache as a single bytecode unit keyed by content hash; module scripts participate in the per-module module map and can be partially invalidated when only one imported file changes. A size slider and eligibility checklist show how cache eligibility differs between the two types, with simulated cold/warm timing bars.
why it shipped
Sites often inline a small bootstrap script into the document head — the bit that decides whether to inject a script-loader, fires analytics, or kicks off hydration. That script is run on every navigation, but until now V8 had to re-parse and compile it every time. Caching the bytecode trims parse + compile time on warm loads. Keying by content hash plus network isolation key means cache entries are safe across sites that happen to inline the same code and avoid cross-site information leakage. The change is fully transparent — there's no API.
references
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗