badges/shields

The Cache-Control HTTP header is not enough to prevent GitHub’s CDN caching

Closed this issue · 3 comments

The img.shields.io server sends Cache-Control: no-cache, no-store, must-revalidate HTTP header in order to prevent caching by GitHub’s CDN.

Unfortunately, that’s not enough. According to @bkeepers in github/markup issue #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 either Expires, Last-Modified or Etag. See the Fastly documentation for more info.

If you're still having issues, contact support@github.com

Since img.shields.io doesn’t send any of Expires, Last-Modified or Etag GitHub still caches the badges too much.

Yep, adding any of those other headers should fix it.

Thanks a lot for pointing this out!

IT'S ALIVE!