back-forward-cache
यह क्या करती है
यह स्किल पेजों में ऐसा कोड जाँचती है जो ब्राउज़र को उन्हें तुरंत back और forward नेविगेशन के लिए सहेजने से रोकता है। यह उन डेवलपर के लिए है जो साइट के भीतर पेजों पर तेज़ी से लौटना चाहते हैं।
कब इस्तेमाल करें
- ✓जब विज़िटर back पर क्लिक करने के बाद पेज धीरे लोड होते हैं।
- ✓जब कोई पेज unload listeners या हमेशा चलने वाला beforeunload प्रॉम्प्ट इस्तेमाल करता है।
- ✓जब पेज वापस आने के बाद समय-संवेदनशील डेटा ताज़ा होना चाहिए।
Skill का लिंक
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/back-forward-cache/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे चेकआउट पेजों में ऐसी चीज़ें जाँचें जो back नेविगेशन को तुरंत होने से रोकती हों।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट unload listeners और बिना शर्त वाले beforeunload हैंडलर खोजता है, उस तर्क को pagehide और pageshow में ले जाता है, और सिर्फ़ वही डेटा ताज़ा करता है जो बदलना ज़रूरी है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Optimize pages for back/forward cache
Back/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.
Quick Reference
- Never add an
unloadlistener - it is the most common bfcache blocker - Use
pagehideandpageshowinstead of assuming every navigation reloads - Refresh time-sensitive state when
pageshow.persistedistrue - Keep
beforeunloadconditional and remove it when there are no unsaved changes - Verify eligibility in DevTools instead of assuming a page is cacheable
Check
Review 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.
Fix
Replace unload logic with pagehide and pageshow handlers, remove unnecessary blockers, and refresh only the time-sensitive state that must change after a bfcache restore.
Explain
Explain how the back/forward cache differs from HTTP caching, why unload blocks it, and how pageshow/pagehide should be used instead.
Code Review
Review 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.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/back-forward-cache
अक्सर पूछे जाने वाले सवाल
back और forward cache क्या है?
स्किल इसे पूरे पेज को मेमोरी में रखने का तरीका बताती है, ताकि वह नेटवर्क से दोबारा बनाए बिना तेज़ी से वापस आ सके।
यह सबसे ज़्यादा किससे रुकता है?
स्किल के अनुसार unload listener सबसे आम रुकावट है।
मैं कैसे पक्का करूँ कि पेज योग्य है?
स्किल कहती है कि ब्राउज़र डेवलपर टूल में योग्यता की जाँच करें।
जानकारी
लेखक का मूल विवरण
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.
लोकप्रियता
- GitHub स्टार
- 75k
- रैंकिंग में स्थान
- #2754
- लाइसेंस
- MIT
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
frontendchecklist
75kकमांड-लाइन टूल से फ़्रंटएंड कोड और लाइव पेजों को एक्सेसिबिलिटी, स्पीड, SEO और सिक्योरिटी के 380 से ज़्यादा नियमों से जाँचती है।
frontend-checklist-global
75kफ़्रंटएंड प्रोजेक्ट को Front-End Checklist के सभी 386 नियमों से ऑडिट करती है, और हर मिली समस्या का ठोस समाधान देती है।
404-page
75kजाँचती है कि आपका गुम पेज उपयोगी लिंक देता है और सही 404 स्टेटस लौटाता है, ताकि भटके हुए विज़िटर रास्ता ढूँढ सकें।
about-page
75kजाँचती है कि आपकी साइट पर एक साफ़ About पेज है जो बताता है कि उसे कौन चलाता है, ताकि विज़िटर और सर्च इंजन का भरोसा बढ़े।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।