Cloud CDN
debt(d5/e5/b5/t5)
Closest to 'specialist tool catches' (d5). The detection_hints list CloudFront, Cloudflare, Fastly dashboards and Lighthouse as tools that can identify CDN misconfigurations. These are specialist tools — not default linters — that catch issues like missing Cache-Control headers, incorrect Vary headers, or cached authenticated responses. Runtime monitoring dashboards reveal cache hit ratios that expose problems.
Closest to 'touches multiple files / significant refactor in one component' (e5). The quick_fix involves configuring cache behaviours per path pattern (/api/* no-cache, /assets/* 1 year, /* pages short TTL), which requires coordinating CDN configuration with application headers across multiple endpoints. Fixing common_mistakes like 'Caching authenticated responses' or implementing 'tag-based purge strategy' requires changes across both infrastructure config and application code, but stays within one component (the caching layer).
Closest to 'persistent productivity tax' (b5). CDN configuration applies to web contexts and affects how all HTTP responses must be designed — every endpoint needs appropriate Cache-Control headers, Vary headers, and consideration of cache invalidation. The choice shapes ongoing development (new features must consider cacheability) but doesn't define the entire system architecture.
Closest to 'notable trap' (t5). The misconception states 'CDN is only for static files — dynamic API responses with correct Cache-Control headers are also CDN-cacheable.' This is a documented gotcha that most developers eventually learn. The trap of caching authenticated responses (leaking user data) is serious but well-documented in CDN literature, making it a known pitfall rather than a catastrophic hidden trap.
Also Known As
TL;DR
Explanation
CloudFront integrates with AWS; Fastly has instant global purge; Cloudflare adds WAF and DDoS. Dynamic PHP responses with Cache-Control: public, s-maxage=N are CDN-cacheable too.
Common Misconception
Why It Matters
Common Mistakes
- No Cache-Control header
- Caching authenticated responses
- Missing Vary: Accept-Encoding
- No tag-based purge strategy
Code Examples
return response()->json(Product::all()); // No cache headers
return response()->json($products)->header('Cache-Control','public, s-maxage=300, stale-while-revalidate=60');