Skip to content

Rule · Performance

Page is not eligible for the back/forward cache

perf/bfcache-blockedwarnvoid perfupdated

Why it matters

bfcache makes back/forward navigations instant. An unload listener (or similar blocker) forces a full reload instead.

How to fix it

Replace unload handlers with pagehide or visibilitychange, and only add beforeunload while there are unsaved changes.

Example

ts
addEventListener('pagehide', flushAnalytics);

References

void perf reports 25 rules in this category. Core Web Vitals and bytes: LCP, CLS, TBT, TTFB, JavaScript, CSS, fonts, images, caching and compression, measured as the median of several runs on a throttled mobile and a desktop profile.