From 1ae0634b6adbcd74b1631eedb2e2f367c42febfc Mon Sep 17 00:00:00 2001 From: Robin Stevens Date: Mon, 11 May 2026 14:42:28 +0200 Subject: [PATCH 1/2] Add bidCacheFilterFunction to types --- src/config.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/config.ts b/src/config.ts index 10ca390e9e..d2dfc022bd 100644 --- a/src/config.ts +++ b/src/config.ts @@ -220,6 +220,21 @@ export interface Config { * However, if you’d like, you can disable this feature and prevent Prebid.js from using anything but the latest bids for a given auction. */ useBidCache?: boolean; + /** + * When Bid Caching is turned on, a custom Filter Function can be defined to gain more granular control over which “cached” bids can be used. + * This function will only be called for “cached” bids from previous auctions, not “current” bids from the most recent auction. + * The function should take a single bid object argument, and return true to use the cached bid, or false to not use the cached bid. + * + * For Example, to turn on Bid Caching, but exclude cached video bids, you could do this: + * + * ``` + * pbjs.setConfig({ + * useBidCache: true, + * bidCacheFilterFunction: bid => bid.mediaType !== 'video' + * }); + * ``` + */ + bidCacheFilterFunction?: (bid: Bid) => boolean; /** * You can prevent Prebid.js from reading or writing cookies or HTML localstorage by setting this to false. */ From 989c6b93361d797033a8b21193e943f5fb82c18b Mon Sep 17 00:00:00 2001 From: Robin Stevens Date: Mon, 11 May 2026 14:50:28 +0200 Subject: [PATCH 2/2] Fix linting errors --- src/config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.ts b/src/config.ts index d2dfc022bd..374d55b719 100644 --- a/src/config.ts +++ b/src/config.ts @@ -221,9 +221,9 @@ export interface Config { */ useBidCache?: boolean; /** - * When Bid Caching is turned on, a custom Filter Function can be defined to gain more granular control over which “cached” bids can be used. - * This function will only be called for “cached” bids from previous auctions, not “current” bids from the most recent auction. - * The function should take a single bid object argument, and return true to use the cached bid, or false to not use the cached bid. + * When Bid Caching is turned on, a custom Filter Function can be defined to gain more granular control over which “cached” bids can be used. + * This function will only be called for “cached” bids from previous auctions, not “current” bids from the most recent auction. + * The function should take a single bid object argument, and return true to use the cached bid, or false to not use the cached bid. * * For Example, to turn on Bid Caching, but exclude cached video bids, you could do this: *