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?
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?