You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a quick recap, there are three potential obstacles before a badge gets updated and displayed properly:
the frequency of updates on shields.io side
GitHub's own camo.githubusercontent.com cache (which can be purged faster with a scheduled action)
the visitor's individual browser cache
For this report, let's focus on the third obstacle: the browser cache. Apparently, the HTML response header of the Contributors Display comes with cache-control: public, max-age=31536000, which basically means the browser is told to cache the badge's image for a whole year before requesting a newer version. In other words, the badge won't update the contributors unless the visitor manually purges the browser cache.
Most shields.io badges come with a relatively low cache max-age, e.g. release date: max-age=120, downloads counter: max-age=900, static badge: max-age=86400. Your Visits badge also comes with an acceptable cache-control: max-age=86400, s-maxage=86400 (24 hours). This is indeed reflected by visiting the affected repository; all badges get updated at some point except for Contributors Display which remains completely static until the browser cache is manually cleared.
Would it be possible to tweak the HTML header of Contributors Display to send a reasonable max-age=86400 rather than 365 days?
The text was updated successfully, but these errors were encountered:
skellytz
added a commit
to Spellhold-Studios/Infinity-Animations
that referenced
this issue
Sep 18, 2024
As a quick recap, there are three potential obstacles before a badge gets updated and displayed properly:
For this report, let's focus on the third obstacle: the browser cache. Apparently, the HTML response header of the Contributors Display comes with
cache-control: public, max-age=31536000
, which basically means the browser is told to cache the badge's image for a whole year before requesting a newer version. In other words, the badge won't update the contributors unless the visitor manually purges the browser cache.Most shields.io badges come with a relatively low cache max-age, e.g. release date:
max-age=120
, downloads counter:max-age=900
, static badge:max-age=86400
. Your Visits badge also comes with an acceptablecache-control: max-age=86400, s-maxage=86400
(24 hours). This is indeed reflected by visiting the affected repository; all badges get updated at some point except for Contributors Display which remains completely static until the browser cache is manually cleared.Would it be possible to tweak the HTML header of Contributors Display to send a reasonable
max-age=86400
rather than 365 days?The text was updated successfully, but these errors were encountered: