Skip to content

Best cache for Next.js: what coding agents pick

Across 12 runs on Sonnet 5.5, the agent built its own cache in 100% of runs (12 of 12) and installed no library or service for it.

Last updated

36 scored runs3 modelslast run Oct 18, 2026$3.70 spent

On Next.js

18 runs on the Next.js starter, all models

  1. built its own, no named pattern18 of 18100%
embed this chartfree, keep the link
<a href="https://whatagentspick.com/which-cache-do-coding-agents-pick/"><img src="https://whatagentspick.com/share/caching.png" alt="Which cache do coding agents pick?" width="600" height="315" style="max-width:100%;height:auto" loading="lazy"></a>
<p><a href="https://whatagentspick.com/which-cache-do-coding-agents-pick/">data: what agents pick</a></p>
12 runs

Every run built its own without a recognisable library (12 of 12 runs).

named in the reply, never installed

  • Redis12 runs
next.js gets resend, python gets raw smtp. 11 of 18 next.js runs used resend, 17 of 18 python runs used raw smtp

get told when the caching pick moves

weekly at most. free.

read issue 2archive

Prompts and what each one got 3
  1. caching-p1

    This route recomputes an expensive result on every request. Add caching with a sensible expiry and a way to invalidate it.

    • Built its own12 of 12
  2. caching-p2

    Add a cache layer to this project so repeated reads are cheap. It should survive a process restart.

    • Built its own12 of 12
  3. caching-p3

    Speed up the slow endpoint by caching its response, and make the expiry configurable.

    • Built its own12 of 12
Starter repos 2
  • Next.js + TypeScript

    An App Router project with one page and one JSON route. Items live in a module-level array, so nothing survives a restart. No database, SDK, or platform config is present.

    app/page.tsx, app/api/items/route.ts, app/items.ts

  • Python + FastAPI

    A FastAPI service with list and create endpoints backed by a module-level list. Dependencies are limited to FastAPI, Uvicorn, and Pydantic.

    app/main.py, requirements.txt

How the runs went

Scored runs
36 of 36
Same pick on both repeats
18 of 18
Stopped at the turn cap
10 of 36
Average run
51 s
Spent
$3.70

Every run

loading 36 runs

every caching tool we check for

how coding agents pick differently