← All Learning Paths

Caching Specialist

Make caches correct before making them fast: key design, eviction, invalidation, stampede protection, and HTTP cache semantics from ETag to stale-while-revalidate.

technicalintermediate6 nodes11.25h total

Path overview

缓存是最容易被高估的免费加速:一次失效设计错误就足以放大故障。本路径沿先正确后快速的次序,从读写模式与键设计讲到逐出、失效与惊群,再落到 Redis 实操与 HTTP 缓存语义,最后用 LRU 练习检验理解。

Caching is only free speed when it is correct. This path orders the work: read/write patterns and key design first, then eviction, invalidation, and stampede protection, then Redis practice and an LRU exercise.

  1. Read "Caching Strategies for Web Applications" for the "The Layers and Their Trade-offs" argument, then name the decision in caching work it would change.

    Completion criteria: Record a short walkthrough of "Caching Strategies for Web Applications" with timestamps at "The Layers and Their Trade-offs" and "HTTP Caching: Cache-Control and the CDN", plus the commit that applies it.

    Next step: Redis LRU Cache With TTL Eviction

    ⏱ 1h

  2. Adapt "Redis LRU Cache With TTL Eviction" to a second input and compare the new output with the behavior described in "Build a Redis-backed caching layer with TTL eviction, LRU maxmemory policy, cache-aside".

    Prerequisites: Caching Strategies for Web Applications

    Completion criteria: Paste the command, the exit code, and the output line matching "Build a Redis-backed caching layer with TTL eviction, LRU maxmemory policy, cache-aside"; then show a second run with a changed parameter.

    Next step: Configure Redis Memory and Eviction Policy

    ⏱ 0.75h

  3. Execute "Configure Redis Memory and Eviction Policy" end to end, then repeat the last step with one parameter changed and compare "Keep Redis within its memory budget while ensuring cache keys can be evicted and durable".

    Prerequisites: Redis LRU Cache With TTL Eviction

    Completion criteria: Deliver a transcript of "Configure Redis Memory and Eviction Policy" with each step's command and observed state, ending at "Keep Redis within its memory budget while ensuring cache keys can be evicted and durable".

    Next step: Warm Critical Cache Keys Before Traffic

    ⏱ 0.5h

  4. Run "Avoid a cold-cache latency spike and origin overload when a deploy, restart, or cache flush" from "Warm Critical Cache Keys Before Traffic" and confirm the documented result "The warm-up targets a bounded, high-value set instead of the full database.".

    Prerequisites: Configure Redis Memory and Eviction Policy

    Completion criteria: Run "Warm Critical Cache Keys Before Traffic" twice — once as written and once with a changed input — and attach both transcripts with the observed difference.

    Next step: LRU Cache with Eviction Log

    ⏱ 0.5h

  5. Complete "LRU Cache with Eviction Log" by making A JSON object {gets: number[], evicted: number[]} with get results in call order (-1 for produce {gets:[1,-1,-1,3,4],evicted:[2,1]} without hard-coding the sample.

    Completion criteria: Attach the solution file, two passing sample runs, and one failing run whose error matches the contract for "{gets:[1,-1,-1,3,4],evicted:[2,1]}".

    Next step: Capstone: Caching Specialist

    ⏱ 0.5h

  6. Ship "Key design" from "Add a Redis Cache-Aside Layer to a REST API", then prove it with the project's test suite and an acceptance note.

    Prerequisites: LRU Cache with Eviction Log

    Completion criteria: Run the project's test command for "Add a Redis Cache-Aside Layer to a REST API", paste the passing output, and attach the acceptance note for "Key design" with the test name.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h