Badges in github cached aggressively
See original GitHub issueI have noticed that badgen images are cached aggresively in github README.md
pages.
Github does not show the newest image (e.g. after the travis build is now successful).
See also: https://github.com/github/markup/issues/224
I assume that the headers set for badgen images are not compliant with the expectations in github markdown rendering.
Please compare the headers of the badgen image with the travis image (showing correctly in github). Note especially the missing ETag and different Cache-Control headers.
Request URL: https://badgen.net/travis/eobermuhlner/jshell-scriptengine
Request Method: GET
Status Code: 200
Remote Address: 34.65.177.142:443
Referrer Policy: no-referrer-when-downgrade
accept-ranges: bytes
cache-control: public, max-age=60, s-maxage=10800, stale-while-revalidate=604800, stale-if-error=604800
content-length: 909
content-type: image/svg+xml;charset=utf-8
date: Sat, 10 Aug 2019 20:20:04 GMT
server: now
status: 200
strict-transport-security: max-age=63072000
x-now-id: zrh1:5tsbk-1565468404305-f7b54989b944
x-now-instance: 2086726134
x-now-trace: zrh1,bru1
:authority: badgen.net
:method: GET
:path: /travis/eobermuhlner/jshell-scriptengine
:scheme: https
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
accept-encoding: gzip, deflate, br
accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,pt;q=0.6
cache-control: max-age=0
cookie: _ga=GA1.2.1998362482.1565447264; _gid=GA1.2.1005516287.1565447264
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Request URL: https://api.travis-ci.org/eobermuhlner/jshell-scriptengine.svg?branch=master
Request Method: GET
Status Code: 304 Not Modified
Remote Address: 50.19.95.74:443
Referrer Policy: no-referrer-when-downgrade
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Type, Cache-Control, Expires, Etag, Last-Modified, X-Request-ID
Cache-Control: no-cache, private
Connection: keep-alive
Content-Length: 0
Date: Sat, 10 Aug 2019 20:21:34 GMT
Etag: "2846a7d1dcb3a21c0cc9c9216fd307b7"
Server: nginx
Strict-Transport-Security: max-age=31536000
Vary: Accept
Via: 1.1 vegur
X-Accepted-Oauth-Scopes: public
X-Endpoint: Travis::Api::App::Endpoint::RepoStatus
X-Oauth-Scopes: public
X-Pattern: /:owner_name/:name
X-Rack-Cache: miss
X-Request-Id: c5895a1d-10d4-4912-94eb-e1d29e7cc233
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,pt;q=0.6
Cache-Control: max-age=0
Connection: keep-alive
Cookie: __utmc=32124027; __utmz=32124027.1565464132.12.7.utmcsr=github.com|utmccn=(referral)|utmcmd=referral|utmcct=/eobermuhlner/jshell-scriptengine; __utma=32124027.314419808.1551556926.1565464132.1565468467.13; __utmt=1; __utmb=32124027.1.10.1565468467
Host: api.travis-ci.org
If-Modified-Since: Sat, 10 Aug 2019 17:56:03 GMT
If-None-Match: "2846a7d1dcb3a21c0cc9c9216fd307b7"
Referer: https://travis-ci.org/eobermuhlner/jshell-scriptengine
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
branch: master
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Github badge caching is way too aggressive #915
Caches last more than 24 hours e.g. The underlying image has long changed: Would be nice ... Github badge caching is way too...
Read more >Aggressive image caching breaks image badges #224 - GitHub
Seems like the way README images are cached by GitHub is too aggressive. For instance its braking the Cocoapods' badges like the one...
Read more >GitHub aggressively caches status badges: need HTTP ...
My "docs status" badge is stuck on red, because GitHub caches them. Here's the GitHub issue discussing the caching headers needed: ...
Read more >sbts/github-badge-cache-buster
A small tool that uses curl to PURGE the github cache for badges displayed in README.md ... #17057 - Aggressive GitHub caching breaks...
Read more >I think lowercase header field names are breaking badge ...
I have a repo for which badge caching is broken: https://github.com/jcoreio/crater Here is the badge URL: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, thanks a lot. Btw,
badgen
is amazing, super fast and never broken. Thank you!Yep, I guess so 😄