Help us understand the problem. What is going on with this article?

GitHubのREADME上の画像キャッシュはPURGEリクエストで破棄させられる

More than 3 years have passed since last update.

GitHubのREADMEの画像,とくにビルドステータス・カバレッジ・コードクオリティ関連のものが長期間キャッシュされてしまって困ったことは無いでしょうか?

img

RFCで標準化されていないようですが,PURGEというHTTPメソッドでリクエストを送るとそれを破棄させることができるようです。

curlコマンドの-Xオプションを使用
mpyw@localhost:~$ curl -X PURGE https://camo.githubusercontent.com/f3bff8cae56a5e157f25ed6bf0a76aa610832897/68747470733a2f2f7472617669732d63692e6f72672f6d7079772f657863657065722e7376673f6272616e63683d6d6173746572
{"status": "ok", "id": "397-1491501868-70734"}

いちいち1個1個インスペクタで調べるのも面倒なので,スクレイピングして自動でリクエストを送るシェルスクリプトを書きました。

mpyw/hub-purge: Clear GitHub image caches on README

使用例
mpyw@localhost:~$ hub-purge mpyw/co mpyw/cowitter mpyw/php-hyper-builtin-server mpyw/exceper 
Fetching: https://github.com/mpyw/co
Fetching: https://github.com/mpyw/cowitter
Fetching: https://github.com/mpyw/php-hyper-builtin-server
Fetching: https://github.com/mpyw/exceper
Purging: https://camo.githubusercontent.com/aee60d37fae05af268e89fec187311cbfcdcc2ea/68747470733a2f2f7472617669732d63692e6f72672f6d7079772f7068702d68797065722d6275696c74696e2d7365727665722e7376673f6272616e63683d6d6173746572
Purging: https://camo.githubusercontent.com/730f7deb762c1334f59cadb72111262f74a718a4/68747470733a2f2f7472617669732d63692e6f72672f6d7079772f636f2e7376673f6272616e63683d6d6173746572
Purging: https://camo.githubusercontent.com/f3bff8cae56a5e157f25ed6bf0a76aa610832897/68747470733a2f2f7472617669732d63692e6f72672f6d7079772f657863657065722e7376673f6272616e63683d6d6173746572
Purging: https://camo.githubusercontent.com/e5e3d68e65bd6c9922e40dad8003f4aeb49ffd0e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7079772f7068702d68797065722d6275696c74696e2d7365727665722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572
Purging: https://camo.githubusercontent.com/f7e4d8bb540f5418242df6cb23da2c69bea31d30/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7079772f636f7769747465722f6261646765732f6275696c642e706e673f623d6d6173746572
Purging: https://camo.githubusercontent.com/11c32d7a00c83ff76a57984bcad1bd6772020ee1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d7079772f657863657065722f62616467652e7376673f6272616e63683d6d6173746572
Purging: https://camo.githubusercontent.com/8e895d8ad6fe3403d68859a8fec73d81b09f9f83/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d7079772f636f2f62616467652e7376673f6272616e63683d6d6173746572
Purging: https://camo.githubusercontent.com/5ef75697c52c3bebb46a10c00a17a527cc6c03e0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7079772f636f7769747465722f6261646765732f636f7665726167652e706e673f623d6d6173746572
Purging: https://camo.githubusercontent.com/12c40f97da07541cc6e3561bb7312872c1255bce/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7079772f636f7769747465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572
Purging: https://camo.githubusercontent.com/9adea0c1258932734316eac1137cad998da262e3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7079772f657863657065722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572
Purging: https://camo.githubusercontent.com/91b090d2115278ccbcb4250a8b636470515a9c02/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7079772f636f2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572

mpyw@localhost:~$

きっと便利。

mpyw
PHP(Laravel) / JavaScript(React/Redux/ReactNative/Vue) / MySQL あたりが得意分野なWeb系エンジニア。最近マンネリ化がひどいので Go / Kotlin / Rust / Swift あたりから何か掘り下げたいと思っている。Go は 2.x 出てから書きます。古い記事はそのまま参考にしないようにご注意ください
http://gravatar.com/mpyw
synapse
Synapseは、オンラインサロンサービスにおけるパイオニアとして、かつて存在していたスタートアップです。
https://synapseam.github.io/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした