Lộ trình đang học Current learning path

Application Services Application Services

Bảo vệ và tăng tốc website, application và API. Protect and accelerate websites, applications, and APIs.

Về trang lộ trình Track home

Phần 4: Content delivery & tăng tốc website Part 4: Content delivery & website speed · Bài 1/4 Lesson 1/4

CDN & cache hit/miss CDN & cache hit/miss

Hiểu HIT tại PoP vs MISS về origin. Cache static assets; không cache HTML có session. Understand PoP HIT vs MISS to origin. Cache static assets; do not cache HTML with sessions.

CDN & cache hit/miss
Minh họa từ Cloudflare Reference Architecture (developers.cloudflare.com) Illustration from Cloudflare Reference Architecture (developers.cloudflare.com)

Các bước thực hiện Step-by-step

  1. Caching → Configuration: xem Cache Rules mặc định. Caching → Configuration: review default Cache Rules.
  2. Mở Caching → Cache Rules: cache static (/assets/*, *.css, *.js). Caching → Cache Rules: cache static paths (/assets/*, *.css, *.js).
  3. Bypass cache cho /admin, /checkout, cookie session. Bypass cache for /admin, /checkout, session cookies.
  4. Kiểm tra response header `CF-Cache-Status`: HIT vs MISS. Check response header `CF-Cache-Status`: HIT vs MISS.

Giải thích chi tiết Detailed explanation

CDN cache giảm latency và chi phí origin — nhưng cache nhầm HTML có session sẽ lộ data user. CDN cache cuts latency and origin cost — but caching session HTML leaks user data.

Lưu ý (best practices) Note (best practices)

Bật Tiered Cache (có trên mọi gói) — cache gần user hơn, giảm request về origin và tăng cache hit ratio. Enable Tiered Cache (included on every plan) — content is cached closer to users, reducing origin requests and improving cache hit ratios.

Nguồn: Source: Content Delivery Network (CDN) Reference Architecture Content Delivery Network (CDN) Reference Architecture

Ví dụ triển khai (Cloudflare Resources) Deployment examples (Cloudflare Resources)

Ví dụ chính thức từ Cloudflare Resources — gợi ý theo chủ đề bài học trong lộ trình này. Official examples from Cloudflare Resources — matched to this lesson within this path.

Sơ đồ kiến trúc Reference architecture diagram Chung / đa lĩnh vực Cross-cutting

Designing a distributed web performance architecture

/reference-architecture/diagrams/content-delivery/distributed-web-performance-architecture

Mở tutorial / guide ↗ Open tutorial / guide ↗

Xem thêm ví dụ trong lộ trình → More examples in this path →

Tài liệu Cloudflare Developers Cloudflare Developer docs

Sơ đồ kiến trúc (Cloudflare Docs) Architecture diagrams (Cloudflare Docs)

Figure 1: Data flow overview

Designing a distributed web performance architecture Designing a distributed web performance architecture

Pattern L7: data flow, cache tiers, deployment models — giảm latency và cải thiện Core Web Vitals. A prescriptive pattern for building a Cloudflare-based L7 performance architecture that reduces latency, raises cache efficiency, and improves Core Web Vitals.

Thuật ngữ: Concepts: CDN · Cache · Core Web Vitals · Smart Shield · Argo

Sơ đồ chính thức ↗ Official diagram ↗ · Content delivery Content Delivery

Sản phẩm liên quan Related products

Học xong hoặc muốn đổi hướng? Finished or want a different path?

Ba lộ trình độc lập — mỗi lộ trình chỉ gồm bài học và tài liệu trong phạm vi đó. Chọn lộ trình khác khi sẵn sàng, không cần học song song. Three independent paths — each includes only lessons and materials for that scope. Switch when you are ready; no need to study paths in parallel.

Chưa chắc — làm bài chọn lộ trình Not sure — use the path selector · So sánh cả ba lộ trình Compare all three paths