GitHub의 README의 이미지 캐시는 PURGE 요청으로 삭제됩니다.

GitHub의 README 이미지, 특히 빌드 스테이터스 커버리지 코드 퀄리티 관련의 것이 장기간 캐쉬되어 버려 곤란한 적은 없습니까?



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:~$

반드시 편리.

좋은 웹페이지 즐겨찾기