increase max-age for download and social badges; affects [twitch] #6567
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.
We serve a lot of download and social badges (collectively download and social categories account for ~25% of the traffic we serve from Heroku) and we serve them with the default max-age (2 mins).
In a lot of cases the upstream providers cache these totals and we also often present them as rounded numbers e.g:
downloads | 20k
stars | 3k
I think we can get away with cacheing these for longer and serve more of these badge requests from downstream cache without noticeably downgrading service for most users. Lets try setting them to 15 mins and see how it goes.
I've decided to manually exclude twitch status from this and actually set a shorter max-age on it as "live now" seems like it need to be more immediate to be useful. I think all other download and social badges can use the new default.