Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub aggressively caches status badges: need HTTP headers to prevent it. #1612

Closed
nedbat opened this issue Aug 30, 2015 · 11 comments
Closed
Labels
Improvement Minor improvement to code Operations Operations or server issue

Comments

@nedbat
Copy link
Contributor

nedbat commented Aug 30, 2015

My "docs status" badge is stuck on red, because GitHub caches them. Here's the GitHub issue discussing the caching headers needed: github/markup#224 I'm not sure rtfd's redirect to shields.io affects things.

@agjohnson
Copy link
Contributor

Agreed, we should be doing this. If we can't do this in the badge view, we can do it in the production environment.

@agjohnson agjohnson added Improvement Minor improvement to code Operations Operations or server issue labels Aug 31, 2015
@mattions
Copy link

mattions commented Sep 3, 2015

+1 on this one

@gregmuellegger
Copy link
Contributor

Possible fix: #1653

@flavio
Copy link

flavio commented Jan 30, 2016

I'm still affected by this issue even though the code has been merged.

@tbleiker
Copy link

Same here...

Edit: When I try to open the link in the browser (e.g. https://readthe.../badge/?version=latest), I get a url redirection (302 Found) and the image from img.shields.io. However, there the Cache-Control header is not set correctly ("public, max-age=86400").

@wishstudio
Copy link

+1 to this issue.

@jonasrauber
Copy link
Contributor

This problem still exists. According to GitHub, the solution is to set Expries, Last-Modified or Etag in addition to Cache-Control: no-cache, which is not happening right now.

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.

jonasrauber added a commit to jonasrauber/readthedocs.org that referenced this issue Jun 8, 2017
using the never_cache decorator should set `Expires` to now
@jonasrauber
Copy link
Contributor

I created a pull-request to fix this: #2927

jonasrauber added a commit to jonasrauber/readthedocs.org that referenced this issue Jun 9, 2017
using the never_cache decorator should set `Expires` to now
ericholscher added a commit that referenced this issue Jun 13, 2017
wmayner added a commit to wmayner/readthedocs.org that referenced this issue Jul 17, 2017
Pass on the `maxAge` query parameter when redirecting to the badge image
from Shields.io. This should help with GitHub's unwanted badge caching.
The default is 1 day.
ericholscher added a commit that referenced this issue Jul 18, 2017
@ericholscher
Copy link
Member

Should be fixed by #3005 👍

@fritzo
Copy link

fritzo commented Aug 21, 2017

I'm still seeing this issue. To reproduce:

  1. create a new rtfd project with broken build
  2. add a badge to the project's github README.md
  3. fix the rtfd build

@Parker8283
Copy link

I am also still seeing this issue with my School Project Repo. The builds were failing, they were fixed about 3 days ago, but the failing badge still persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code Operations Operations or server issue
Projects
None yet
Development

No branches or pull requests