August 21, 2026
Configurable caching in Stagehand
Stagehand v4 caches act(), observe(), and extract() results on Browserbase's servers. Now you control it.
Pass cache to set a hit-count threshold - how many identical results Browserbase must see before it starts serving that result from the cache. A hit skips inference entirely: no model call, no tokens.
Plus:
- Every call can override the instance setting; pass
cache: falseto skip the cache for a single step. - Results carry
metadata.cachewith aHIT/MISS/DISABLEDstatus, a miss reason, and the tokens a hit saved. - Model configuration stays out of the cache key, so switching models does not invalidate your cache.