Disable github cache for internal teamcity build status image in README.md
Asked Answered
K

1

11

I have a TeamCity Build Status Icon in github README.md which looks as follows

[![Build Status](http://<internal-tc-server>:8111/app/rest/builds/buildType:(id:BuildID)/statusIcon)](http://<internal-tc-server>/viewType.html?buildTypeId=BuildID&guest=1)

Looks like Github caches the images in README.md and the new image src url looks as follows.

<img src="https://github-camo.global.ssl.fastly.net/xxx/yyy"/>

Since the teamcity url is within our internal network, github will not be able to access it and cant cache it properly. So, I don't see any image in the README. Is there any Image tag that I can use to disable the automatic github image caching?

Konrad answered 17/3, 2014 at 21:12 Comment(3)
Disabling the CDN is not possible currently: github.com/blog/1766-proxying-user-images. However, you might consider exposing the image via a public endpoint which doesn't require authentication, but uses unguessable tokens instead (e.g. https://<public_server>/images/<build_id>?token=<random_token>).Pompadour
Any luck since 2014? :)Accurate
This situation sucks and means that we cannot have a status badge while our build server remains off the internet.Monty
C
0

It is an old question, but because there are still answers to it: Github has now a possibility to handle their camo cache. https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls

If you are able to set the Cache-Control header to no-cache Github should ignore the image for caching. But this does not work for private Networks as Github has documented it here: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls#viewing-images-on-private-networks

Catsup answered 7/8, 2023 at 6:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.