If you upload an image to GitHub, the URL of the image will be modified so your information is not trackable.

GitHub uses an open-source project called Camo to provide a proxy for images hosted on GitHub. A proxy is an intermediate server that provides anonymity for users. It helps protect your privacy by preventing browser information to be leaked to third-parties that may be snooping in. If a user hosts an image on another server and links to it on GitHub, users viewing that image have no guarantee that their browser information (and more) isn't being sent elsewhere.

GitHub solves this with Camo by hosting the image for you. URLs that go through Camo end up looking something like this:

https://camo.githubusercontent.com/4d04abe0044d94fefcf9af21332239dbebf01ded/68747470733...

Camo also ensures that all resources are being served through HTTPS and are secure. Furthermore, we host and cache these images on a CDN, so they are served blazing fast.

For more information on Camo, check out our original blog post.

Troubleshooting issues with Camo

In rare circumstances, images that are processed through Camo might not appear on GitHub. Here are some steps you can take to determine where the problem lies.

Windows users will either need to use the Git Powershell (which is installed alongside GitHub Desktop) or download curl for Windows.

An image is not showing up

If an image is showing up in your browser but not on GitHub, you can try requesting the image locally.

  1. Open TerminalTerminalGit Bash.

  2. Request the image using curl.

    curl -i https://www.my-server.com/images/some-image.png -o /dev/null
    HTTP/1.1 200 OK
    Date: Fri, 06 Jun 2014 07:27:43 GMT
    Expires: Sun, 06 Jul 2014 07:27:43 GMT
    Content-Type: image/x-png
    Server: Google Frontend
    Content-Length: 6507
    
  3. Check the value of Content-Type. In this case, it's image/x-png.

  4. Check that content type against the list of types supported by Camo.

If your content type is not supported by Camo, you can try several actions:

  • If you own the server that's hosting the image, modify it so that it returns a correct content type for images.
  • If you're using an external service for hosting images, contact support for that service.
  • Make a pull request to Camo to add your content type to the list.

An image that changed recently is not updating

If you changed an image recently and it's showing up in your browser but not GitHub, you can try resetting the cache of the image.

  1. Open TerminalTerminalGit Bash.

  2. Request the image using curl.

    curl -i https://www.my-server.com/images/some-image.png -o /dev/null
    HTTP/1.1 200 OK
    Expires: Fri, 01 Jan 1984 00:00:00 GMT
    Content-Type: image/png
    Content-Length: 2339
    Server: Jetty(8.y.z-SNAPSHOT)
    

Check the value of Cache-Control. In this example, there's no Cache-Control. In that case:

  • If you own the server that's hosting the image, modify it so that it returns a Cache-Control of no-cache for images.
  • If you're using an external service for hosting images, contact support for that service.

    If Cache-Control is set to no-cache, please contact GitHub Support to resolve the problem.

Removing an image from Camo's cache

Purging the cache forces every GitHub user to re-request the image, so you should use it very sparingly and only in the event that the above steps did not work.

  1. Open TerminalTerminalGit Bash.

  2. Purge the image using curl -X PURGE on the Camo URL.

    curl -X PURGE https://camo.githubusercontent.com/4d04abe0044d94fefcf9af2133223....
    {"status": "ok", "id": "216-8675309-1008701"}
    

Viewing images on private networks

If an image is being served from a private network or from a server that requires authentication, it can't be viewed by GitHub. In fact, it can't be viewed by any user without asking them to log into the server.

To fix this, please move the image to a service that is publicly available.