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

lazy-loading

Skill này làm gì

Skill này kiểm tra nội dung nằm xa phía dưới trang chỉ tải khi cần. Skill dành cho lập trình viên và nhà thiết kế muốn lần tải trang đầu tiên nhẹ hơn.

Khi nào nên dùng

  • ✓Khi một trang dài tải mọi ảnh trước khi khách truy cập cuộn xuống.
  • ✓Khi video nhúng hoặc bản đồ tải ngay từ đầu trang.
  • ✓Khi lần tải đầu tiên của trang tải nhiều dữ liệu hơn nhiều so với những gì khách thấy.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/lazy-loading/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/lazy-loading/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

“Bạn có thể thiết lập tải lười cho các ảnh nằm xa hơn xuống dưới trang của tôi không?”

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

Cách hoạt động

Agent xác định nội dung nằm dưới màn hình đầu tiên và gợi ý tải lười gốc của trình duyệt hoặc Intersection Observer. Agent không tải lười các ảnh quan trọng nhất ở đầu trang.

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.

Implement lazy loading for offscreen content

Lazy loading defers non-critical resources until needed—this reduces initial page weight, speeds up first paint, and saves bandwidth for content users may never scroll to.

Quick Reference

  • Use loading='lazy' for images below the fold
  • Never lazy load LCP/above-fold images—they need priority
  • Lazy load iframes, videos, and heavy components
  • Use Intersection Observer for custom lazy loading
  • If fold position is unclear from the snippet, do not invent a lazy-loading defect

Check

Verify that images and other heavy resources below the fold are lazy loaded. Only report this when the code or route context makes offscreen placement clear.

Fix

Implement lazy loading for images, videos, and iframes using native loading='lazy' or JavaScript solutions.

Explain

Explain how lazy loading defers resource loading until needed, improving initial page load performance.

Code Review

Review the routes, assets, and loading behavior that affect Implement lazy loading for offscreen content. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.


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

Rule page: https://frontendchecklist.io/rules/performance/lazy-loading

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

Tải lười gốc là gì?

Đó là thiết lập có sẵn của trình duyệt, trì hoãn việc tải ảnh hoặc khung cho đến khi chúng gần màn hình.

Điều gì không bao giờ được tải lười?

Skill nói không bao giờ tải lười ảnh nội dung lớn nhất ở đầu trang.

Nếu không rõ vị trí của nội dung thì sao?

Skill nói không báo cáo vấn đề nếu mã không làm rõ vị trí hiển thị.

Chi tiết

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

Use when auditing slow page loads, heavy assets, or rendering delays related to Implement lazy loading for offscreen content. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes. Absence of `loading='lazy'` is not enough by itself when fold position is unknown.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2916
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ự