Aggressive GitHub caching breaks Gitlab badge images.
GitHub proxies HTTP/HTTPS to prevent mixed content warnings. After this change my badges now don't display on GitHub, but work fine elsewhere. The image is able to load - https://gitlab.connortumbleson.com/iBotPeaches/Leafapp/badges/master/build.svg for example.
Per - https://github.com/github/markup/issues/224
We're pretty confident that the image caching works. If you're having issues with something like a CI badge, make sure the image has the
Cache-Control: no-cache header
, and eitherExpires
,Last-Modified
orEtag
.
Looking at the headers, Gitlab correctly sends Cache-Control: no-cache, no-store
and always sends an Expire
in the past like - Mon, 01 Jan 1990 00:00:00 GMT
. However, that doesn't seem to work with GitHub.
Maybe use the last build date as Last-Modified
?