Cache behavior, headers, static assets, and troubleshooting
Lab 4 demonstrates how to determine whether content is cacheable, whether cache rules apply, and how to validate cache hits, misses, dynamic responses, and bypass behavior.
Scenario
A customer says Cloudflare cache is not working. Determine whether the asset is cacheable, whether rules apply, and how to validate cache hits, misses, dynamic responses, and bypass behavior.
Objective
Create a dedicated cache troubleshooting lab that compares cache-friendly static content, non-cacheable dynamic API content, and cache-rule-driven content. The goal is to use response headers and repeated requests to explain why Cloudflare did or did not cache a response.
Outcomes
- Created a static asset path at
/static/logo.txt. - Created or preserved dynamic API behavior for non-cacheable responses.
- Created cache demonstration behavior for
/cache/demo. - Validated cache behavior through response headers.
- Separated Lab 4 cache content from the landing page and unrelated lab pages.
Environment / Build
- Cacheable static asset:
/static/logo.txt - Dynamic/non-cacheable endpoint:
/api/time - Cache demo path:
/cache/demo - Headers inspection page:
/headers/ - Cache validation header:
cf-cache-status - Validation tool: repeated
curl -Irequests
Demonstrable Content
curl -I https://www.ybarra-cflab.com/static/logo.txt curl -I https://www.ybarra-cflab.com/cache/demo curl -I https://www.ybarra-cflab.com/cache/demo curl -I https://www.ybarra-cflab.com/api/time curl -I https://www.ybarra-cflab.com/headers/
What Was Completed
- Created a dedicated Lab 4 page for cache troubleshooting.
- Validated a cache-friendly static asset.
- Validated a dynamic API response intended not to be cached.
- Validated cache demo behavior using repeated requests.
- Added commands that let an SE explain
MISS,HIT,DYNAMIC, and related cache outcomes. - Kept cache content isolated to Lab 4.
Lab 4 Technical Summary
Lab 4 extends the Pages-based environment to demonstrate Cloudflare cache behavior and cache troubleshooting. The lab compares a static asset, a dynamic API response, and a cache-demo path so that response headers can be inspected and explained. Repeated requests help show whether Cloudflare serves an object from cache or treats it as dynamic or non-cacheable. This content is intentionally isolated from the landing page and earlier labs so the cache troubleshooting material does not sprawl across unrelated site content.
Lab 4 Customer-Facing Summary
This lab gives the customer a clear way to understand why Cloudflare cache is or is not being used. Instead of assuming cache is broken, we check the type of content, the response headers, and the cache status. That makes troubleshooting more precise and helps the customer understand whether the fix belongs in cache rules, application headers, asset design, or request patterns.
Static asset check
This verifies that the static asset link is clean. There should be no trailing backslash after
/static/logo.txt.