October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
AI agents

How Caching Works in Stagehand and Where It Breaks

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Stagehand caching is not one feature. In hosted Browserbase runs, Stagehand can cache inference results for act(), extract(), and observe(); separately, agent caching can replay previously recorded actions. The controls, cache keys, and failure modes differ. First identify whether you are using the v3 serverCache API or the Browserbase v4 cache configuration, then check whether the run is local or hosted.

Two caches that are easy to confuse

Server-side inference caching

The v3 Stagehand reference documents a Browserbase server cache for act(), extract(), and observe(). A repeated call with the same relevant inputs can return a previously produced result without consuming LLM tokens. This cache is enabled by default in the documented API, but it only applies when env: "BROWSERBASE" is used; local environments are explicitly unaffected. See the Stagehand v3 class reference.

Agent action replay caching

Agent caching is a different mechanism. It records action steps so an agent can replay a workflow rather than invoke every step again. It is not interchangeable with server-side inference caching: a server-cache hit concerns an inference result, while replay concerns an action sequence. A reported open issue says custom tool calls were omitted from agent-cache recording and replay, which can cause an essential step to be skipped. That report is specific to the described case and should not be treated as proof that every current release has the defect.

Version matters: v3 terminology versus v4 behavior

Context Configuration What the documentation establishes
Stagehand v3 reference serverCache (instance option), with a per-call override Default is true; Browserbase only; applies to act(), extract(), and observe().
Browserbase v4 changelog, August 21, 2026 cache: { threshold: n } at instance or call level, or cache: false A result is served after the configured number of identical results has been observed. Metadata reports status, miss reason, and saved tokens.
Agent replay cache Agent caching and replay controls Separate from inference caching; an open report describes custom-tool steps missing from recording and replay.

Do not copy a v4 cache example into code that expects v3 serverCache, or infer that a v3 MISS has the same semantics as a v4 threshold miss. Check the Stagehand and Browserbase versions actually installed and the API reference for that release.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How v3 server caching is configured

Enable or disable it on the instance

In the v3 API, serverCache is an instance setting and defaults to true. Set it to false when you need uncached inference for the whole instance. The changelog also documents disabling it for individual operations. The setting has no effect in a local environment because the server cache is a Browserbase feature.

Override one operation

For act(), extract(), or observe(), pass the documented per-call override when a single step needs a fresh result. Keep the override scoped to that call rather than turning off caching globally if the remainder of the workflow can safely reuse results. Exact option names can vary between releases, so use the reference matching your installed version: v3 API documentation.

What is and is not covered

  • Documented methods are act(), extract(), and observe().
  • The documented scope is Browserbase server execution, not local execution.
  • The v3 material does not establish a complete public list of cache-key fields, expiration rules, or invalidation triggers.

How the v4 threshold model works

Browserbase’s August 21, 2026 changelog describes configurable caching in Stagehand v4. The threshold controls how many identical results must be observed before a cache hit is served. For example, threshold 2 means the cache begins serving after two identical results have been observed; a step configured with threshold 1 makes its second identical call a hit. These are configuration examples, not latency or cost benchmarks.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Instance and call scope

Set cache: { threshold: n } on the instance for a default policy, then override it on a particular call when a step has different freshness requirements. Pass cache: false to disable caching for one call. The changelog states that model configuration is excluded from the cache key: “Model configuration stays out of the cache key, so switching models does not invalidate your cache.” That does not document every other key component.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read the result metadata

V4 results expose cache metadata with a status such as HIT, MISS, or DISABLED, along with a miss reason and saved-token information. Log these fields with the operation name, URL or page identifier, Stagehand version, environment, and your effective cache setting. A DISABLED status means a policy deliberately bypassed caching; it is not a failed lookup.

Why is Stagehand cacheStatus always MISS?

  1. Confirm the environment. If the run is local, v3 server caching cannot apply. A local MISS or absence of a server-cache benefit is expected.
  2. Confirm the API generation. Determine whether your code uses v3 serverCache or the v4 threshold-based cache. Do not interpret fields from one generation using the other generation’s rules.
  3. Check effective configuration. Inspect both instance defaults and per-call overrides. A call-level serverCache: false (v3) or cache: false (v4) should produce a disabled result rather than a hit.
  4. Inspect miss metadata. In v4, record the stated miss reason and threshold. In v3, record operation inputs and the release version because the public reference does not specify every key or invalidation rule.
  5. Compare identical calls. Small changes to the page state, instruction, extraction schema, selector, headers, cookies, or other inputs may prevent a match. The available v4 description does not enumerate all key fields, so avoid assuming that two calls are identical merely because they use the same URL.

A historical report to treat cautiously

Issue #1767 reports recurring misses for act(), extract(), and observe() with serverCache: true in Stagehand 3.1.0. The issue is marked closed, but the retrieved issue does not establish what fixed it or which release contains a fix. Treat it as a historical diagnostic clue, not a current universal defect; check metadata and reproduce on the exact version you run. See issue #1767.

Why caching can disappoint in local and hosted deployments

Local runs receive no Browserbase server-cache benefit

Running with a local environment is useful for development, but it does not exercise the documented Browserbase server cache. If production uses Browserbase, test cache behavior in that hosted environment as well as locally so you do not mistake an environment difference for a code regression.

Thresholds intentionally delay the first hit

With a threshold greater than one, early identical calls are misses by design while the system observes matching results. A threshold is a policy choice, not a guarantee that the first repeated request is free of inference work.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Cache-key and invalidation details are incomplete

The v4 changelog specifically excludes model configuration from the key, but the available documentation does not establish every key input, expiration policy, or invalidation event. Build monitoring around the status and miss reason you receive instead of promising a hit whenever a URL repeats.

Agent replay and custom tools

If an agent replay omits a step, investigate the replay cache separately from serverCache. An open report says custom tool actions were neither recorded nor replayed, so workflows that depend on those tools could skip required work on replay. Until the behavior is confirmed for your release, make critical custom-tool effects idempotent, verify them after replay, and retain logs that show whether the tool was invoked. Follow the status of issue #1558; its open state does not establish the behavior of every current version.

A practical diagnostic checklist

  • Record Stagehand, Browserbase, and runtime versions.
  • Record env and verify whether the run is local or Browserbase-hosted.
  • Identify the cache type: inference result or agent action replay.
  • Log instance settings and per-call overrides after configuration is merged.
  • For v4, capture cache status, miss reason, threshold, and saved-token metadata.
  • For v3, limit conclusions to the documented methods and compare truly identical calls.
  • Test one call with caching explicitly disabled to separate a cache problem from page or model behavior.
  • If custom tools are involved, verify each tool’s side effect independently during replay.
  • Pin a known-good version before changing several variables at once, then document the result.

Performance, reliability, and cost implications

A cache hit can avoid an LLM inference request and therefore save tokens, as the v3 and v4 descriptions state. No independent performance percentage or latency benchmark is established for these features. Thresholds trade first-hit reuse for confidence that identical results recur. Disabling cache improves freshness but can increase inference work. For reliability, treat cache metadata as an observability signal, not as proof that the underlying page is unchanged; page state, authentication, and dynamic content can still alter outcomes.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your immediate task is obtaining a clean visual record of a page while diagnosing an automation workflow, ScreenshotNeo provides a separate screenshot API and MCP server. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP tools—take_screenshot, get_page_info, and capture_pdf—work with Claude, Cursor, and other MCP clients.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

One request is enough:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for options such as full-page capture, selectors, device presets, custom headers, cookies, waits, blocking rules, PDFs, signed links, asynchronous jobs, and bulk capture. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Frequently Asked Questions

Does Stagehand caching work in local environments?

The documented v3 server cache applies only when env: "BROWSERBASE" is used; local environments are unaffected.

How do I disable Stagehand server caching for one call?

Use the per-call override documented for your version: v3 uses the serverCache control, while v4 supports cache: false.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Are v3 serverCache and v4 cache thresholds interchangeable?

No. They describe different API generations. Verify your installed version before changing configuration.

Why are custom tool calls skipped when an agent cache replays?

An open report describes custom tools omitted from recording and replay. Check your release and verify tool side effects rather than assuming every version is affected.

The Bottom Line

Stagehand caching is predictable only after you separate Browserbase server-side inference caching from agent action replay, match the configuration to your Stagehand version, and verify the execution environment. Use cache metadata and miss reasons for diagnosis, and treat historical issue reports as version-specific evidence rather than universal behavior.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.