Improve football match-header and match info cache time#28692
Open
marjisound wants to merge 3 commits intomainfrom
Open
Improve football match-header and match info cache time#28692marjisound wants to merge 3 commits intomainfrom
marjisound wants to merge 3 commits intomainfrom
Conversation
Contributor
e065f5d to
e73ff0c
Compare
e73ff0c to
708ddd4
Compare
arelra
approved these changes
Apr 1, 2026
| val tier = FootballSummaryPagePicker.getTier() | ||
|
|
||
| val cacheTime = | ||
| if (theMatch.isAboutToStart || theMatch.isLive) CacheTime(10) else CacheTime(300) |
Member
There was a problem hiding this comment.
I'm wondering how the new cache time values align with the current cache time settings in Cached.scala e.g.
frontend/common/app/model/Cached.scala
Lines 29 to 30 in 42c40d5
Would it be possible to use (or create) constants in Cached.scala so all the cache time values are in one place?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
The
/football/api/match-headerendpoint currently uses a cache duration of 10 seconds when a match is live, and 300 seconds (5 minutes) otherwise.This can cause an issue around kickoff time: when a match transitions to live, responses may still be served from the 5-minute cache, delaying the update to the live state.
This PR addresses the issue by reducing the cache duration in the 5 minutes leading up to the start of the match, ensuring the endpoint reflects the live status more promptly when the match starts.
Also the other endpoint for match info
/football/match/:year/:month/:day/$home<[\w\d-\.]+>-v-$away<[\w\d-\.]+>is using a 30 second cache time for all matches. To make it consistent, the same logic is now used for this endpoint so that it'll have 10 seconds cache time for when a match is live or is about to start, otherwise it will have a 300 seconds cache time.