Skip to content

GPTUtils: Prevent caching empty slot info in gptUtils and add empty i… #13706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2025

Conversation

pm-nitin-nimbalkar
Copy link
Contributor

…nfo test cases

Type of change

  • Bugfix

  • Feature

  • New bidder adapter

  • Updated bidder adapter

  • Code style update (formatting, local variables)

  • Refactoring (no functional changes, no api changes)

  • Build related changes

  • CI related changes

  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

  • Other

Description of change

PR: Optimize GPT Slot Info Caching
Changes

  • Added a check to prevent caching empty slot information objects in getGptSlotInfoForAdUnitCode
  • Only cache slot information when it contains actual data

Why

  • Previously, empty objects were being cached when no matching GPT slot was found
  • This led to stale information being returned on subsequent calls, even if the slot became available later

Benefits

  • Ensures fresh slot information is fetched on each call when previous attempts returned no data
  • Prevents unnecessary cache entries for non-existent slots
  • Improves accuracy of ad unit to GPT slot mapping over time as slots become available

Other information

@pm-nitin-nimbalkar pm-nitin-nimbalkar marked this pull request as ready for review July 31, 2025 16:59
@patmmccann patmmccann merged commit 684843e into prebid:master Jul 31, 2025
19 of 20 checks passed
@pm-nitin-nimbalkar pm-nitin-nimbalkar deleted the gptcache-issue branch July 31, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants