Skip to content

Commit 12d13ab

Browse files
committed
Fix duplicate cache logging and add server cache API tests
- Remove redundant cache status logging in request() method that was duplicating the more informative log from attachCacheStatus() - Add comprehensive tests for server cache API logic including: - shouldUseCache() behavior with instance and method-level settings - attachCacheStatus() behavior for attaching cache status to results - Cache bypass header injection for act/extract/observe requests - Cache status logging for cacheable methods
1 parent b5ce917 commit 12d13ab

File tree

2 files changed

+469
-13
lines changed

2 files changed

+469
-13
lines changed

packages/core/lib/v3/api.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -877,19 +877,6 @@ export class StagehandAPIClient {
877877
},
878878
});
879879

880-
// Log cache status if present in response headers
881-
const cacheStatus = response.headers.get("browserbase-cache-status");
882-
if (cacheStatus) {
883-
this.logger({
884-
category: "api",
885-
message: `server cache ${cacheStatus.toLowerCase()}`,
886-
level: 2,
887-
auxiliary: {
888-
"cache-status": { value: cacheStatus, type: "string" },
889-
},
890-
});
891-
}
892-
893880
return response;
894881
}
895882
}

0 commit comments

Comments
 (0)