{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-back-forward-cache-a1db4576a6be","title":"Optimize Pages for Back\/Forward Cache","summary":"Improve navigation performance by enabling browser back\/forward cache, which restores pages from memory instead of rebuilding them from the network. The deliverable is a page that is eligible for back\/forward cache restoration, ensuring faster navigation and reduced network requests.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-back-forward-cache-a1db4576a6be","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-back-forward-cache-a1db4576a6be","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-back-forward-cache-a1db4576a6be.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-back-forward-cache-a1db4576a6be\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Verify eligibility in DevTools instead of assuming a page is cacheable. Ensure `pagehide` and `pageshow` are used for lifecycle management, and avoid unconditional `beforeunload` listeners.","instructions":"---\nname: back-forward-cache\ndescription: \"Use when reviewing navigation performance, browser lifecycle events, or resume-from-memory behavior. Check the actual browser lifecycle and restore path, not only static code patterns.\"\nmetadata:\n  category: performance\n  priority: high\n  difficulty: advanced\n  estimatedTime: \"25\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/performance\/back-forward-cache\n---\n\n# Optimize pages for back\/forward cache\n\nBack\/forward cache turns many browser back and forward navigations into near-instant restores because the entire page is resumed from memory instead of being rebuilt from the network. Losing bfcache eligibility makes common navigations feel far slower than they need to.\n\n## Quick Reference\n\n- Never add an `unload` listener - it is the most common bfcache blocker\n- Use `pagehide` and `pageshow` instead of assuming every navigation reloads\n- Refresh time-sensitive state when `pageshow.persisted` is `true`\n- Keep `beforeunload` conditional and remove it when there are no unsaved changes\n- Verify eligibility in DevTools instead of assuming a page is cacheable\n\n## Check\n\nReview this route for back\/forward cache blockers. Search for unload or unconditional beforeunload listeners, state that assumes every navigation is a full reload, and resource lifecycles that break when the page is resumed from memory.\n\n## Fix\n\nReplace unload logic with pagehide and pageshow handlers, remove unnecessary blockers, and refresh only the time-sensitive state that must change after a bfcache restore.\n\n## Explain\n\nExplain how the back\/forward cache differs from HTTP caching, why unload blocks it, and how pageshow\/pagehide should be used instead.\n\n## Code Review\n\nReview route code, global listeners, analytics hooks, and data-refresh logic related to Optimize pages for back\/forward cache. Flag exact listeners, APIs, or lifecycle assumptions that prevent a restore or leave stale state after a restore.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/performance\/back-forward-cache\n","use_cases":["Enhance user experience by making common navigations faster","Avoid unnecessary network requests during back\/forward navigation","Ensure state is correctly refreshed after a bfcache restore"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/back-forward-cache\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T15:22:31.000000Z","updated_at":"2026-11-23T04:54:44.000000Z","seo_title":"Optimize pages for back forward cache","seo_description":"Improve navigation performance by enabling browser back\/forward cache to restore pages from memory instead of rebuilding them from the network.","seo_keywords":["optimize back forward cache","browser navigation performance","bfcache eligibility check","pageshow pagehide lifecycle","prevent bfcache blockers"]}}