Skip to content

Commit cb1c1f6

Browse files
authored
JS: document new eventHistoryTTL and minBidCacheTTL settings (prebid#4884)
1 parent 615b5fb commit cb1c1f6

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

dev-docs/publisher-api-reference/setConfig.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Core config:
2424
* [Turn on send all bids mode](#setConfig-Send-All-Bids)
2525
* [Configure send bids control](#setConfig-Send-Bids-Control)
2626
* [Bid cache](#setConfig-Use-Bid-Cache)
27+
* [Minimum bid cache TTL](#setConfig-minBidCacheTTL)
28+
* [Event history TTL](#setConfig-eventHistoryTTL)
2729
* [Set the order in which bidders are called](#setConfig-Bidder-Order)
2830
* [Set the page URL](#setConfig-Page-URL)
2931
* [Set price granularity](#setConfig-Price-Granularity)
@@ -279,6 +281,33 @@ pbjs.setConfig({
279281
});
280282
```
281283

284+
#### Minimum bid cache TTL
285+
286+
<a id="setConfig-minBidCacheTTL"></a>
287+
288+
By default, Prebid keeps every bid it receives stored in memory until the user leaves the page. This can cause high memory usage on long-running single-page apps; you can configure Prebid to drop stale bids from memory with `minBidCacheTTL`:
289+
290+
```javascript
291+
pbjs.setConfig({
292+
minBidCacheTTL: 60 // minimum time (in seconds) that bids should be kept in cache
293+
})
294+
```
295+
296+
When set, bids are only kept in memory for the duration of their TTL or the value of `minBidCacheTTL`, whichever is greater. Setting `minBidCacheTTL: 0` causes bids to be dropped as soon as they expire.
297+
298+
#### Event history TTL
299+
300+
<a id="setConfig-eventHistoryTTL"></a>
301+
302+
By default, Prebid keeps in memory a log of every event since the initial page load, and makes it available to analytics adapters and [getEvents()](/dev-docs/publisher-api-reference/getEvents.html).
303+
This can cause high memory usage on long-running single-page apps; you can set a limit on how long events are preserved with `eventHistoryTTL`:
304+
305+
```javascript
306+
pbjs.setConfig({
307+
eventHistoryTTL: 60 // maximum time (in seconds) that events should be kept in memory
308+
})
309+
```
310+
282311
#### Bidder Order
283312

284313
Set the order in which bidders are called:

0 commit comments

Comments
 (0)