Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #3032

speculation-rules

Skill này làm gì

Skill này thiết lập tính năng Speculation Rules của trình duyệt cho các trang có khả năng được mở tiếp theo và kiểm tra các quy tắc không quá rộng. Nó dành cho người làm website nhiều trang muốn chuyển trang nhanh hơn.

Khi nào nên dùng

  • ✓Khi bạn yêu cầu agent làm việc chuyển giữa các trang trên website nhanh hơn.
  • ✓Khi chuyển trang cảm giác chậm và người xem thường đi tới cùng vài trang tiếp theo.
  • ✓Khi bạn muốn rà soát speculation rules để chúng không tải các trang không liên quan hoặc mang tính cá nhân.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/speculation-rules/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/speculation-rules/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chuyển giữa các trang trên website của tôi cảm giác chậm. Bạn có thể thêm speculation rules để trang tiếp theo tải trước không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent thêm một khối Speculation Rules nhắm tới các liên kết trang tiếp theo có khả năng cao nhất. Nó bắt đầu bằng prefetch, tải sớm HTML, và gợi ý prerender cho những trang rất có khả năng được mở tiếp theo.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Use the Speculation Rules API to prefetch and prerender navigations

Navigation latency is one of the biggest contributors to poor Interaction to Next Paint (INP) and overall perceived performance. Prerendering the most likely next page eliminates all network and rendering latency — the user sees the new page in under 100 ms regardless of server response time. Google Search has used this API to deliver its "instant" results page experience.

Quick Reference

  • Use prefetch rules to load the next page's HTML ahead of time
  • Use prerender rules to fully render the next page in the background (instant navigation)
  • Scope rules with href-matches or CSS selector patterns to avoid wasting bandwidth
  • Prefer document rules (CSS selectors) over URL list rules for dynamic sites

Check

Check whether the site uses the Speculation Rules API or equivalent prefetch/prerender techniques for likely navigation targets.

Fix

Add a Speculation Rules JSON block targeting the most likely next-page links, starting with prefetch and graduating to prerender.

Explain

Explain how the Speculation Rules API differs from rel=prefetch and rel=prerender, and how prerendering achieves near-zero navigation latency.

Code Review

Review speculation rule selectors for over-eagerness — flag patterns that would prerender unrelated pages, third-party URLs, or pages with personalised/authenticated content that should not be pre-fetched.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/performance/speculation-rules

Câu hỏi thường gặp

Khác biệt giữa prefetch và prerender là gì?

Skill cho biết prefetch tải trước HTML của trang, còn prerender dựng đầy đủ trang ở nền.

Điều này có thể gây lãng phí băng thông không?

Có, nếu các quy tắc quá rộng, vì vậy skill khuyến nghị giới hạn chúng chặt.

Có nên đưa các trang cá nhân vào không?

Không. Skill cho biết nên tránh prerender các trang được cá nhân hóa hoặc cần đăng nhập.

Chi tiết

Mô tả gốc của tác giả

Use when optimising multi-page navigation performance, reducing INP on page transitions, or implementing progressive enhancement for fast page loads.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#3032
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự