Get raw file from GitHub without waiting for 5-minute cache update

Viewed 2921

GitHub hosts raw files at https://raw.githubusercontent.com. You can use that link to download the raw contents of the file.

When you push a change to the file, it doesn't update instantly. According to this question, the raw files are updated after 5 minutes.

My question is, is there any way to bypass this cool-down and get the raw version of the latest file instantly?

1 Answers

No, there isn't a way to bypass it. GitHub uses caching to make it possible to serve large numbers of requests and that means that URLs on that endpoint may be slightly stale. If you need the latest version, you can access the URL by hash instead of by branch or tag name and that will always be correct. From the main web interface (not a raw file URL), you can hit the y key to automatically switch to an appropriate tree or commit instead of the branch name, and then the raw URLs will be correct for your version of the code.

Related