[yast-commit] [yast/yast-meta] 0e9945: get_repos observes 304 Not Modified
Branch: refs/heads/master Home: https://github.com/yast/yast-meta Commit: 0e99454fbf11acdd437f820eab39c5277bccf4c9 https://github.com/yast/yast-meta/commit/0e99454fbf11acdd437f820eab39c5277bc... Author: Roman Neuhauser <rneuhauser@suse.cz> Date: 2014-03-24 (Mon, 24 Mar 2014) Changed paths: M y2m Log Message: ----------- get_repos observes 304 Not Modified a step towards offline operation, get_repos keeps repository listings on disk, issues http requests with If-None-Match using the ETag from the cached data, and reuses said data when github says 304 Not Modified. while it's not offline-capable yet it's way faster than the previous impl which always did 5 curl requests for each of yast, libyui. (with per_page=100, even though there's just 163 repos in yast/ and 11 in libyui.) it's faster because the common case is just two requests, one for each github org, both resulting in 304 and short-circuiting the fetching right there. it's also not as prone to running into github's throttling of api requests (60 per ip address per hour), which i managed to run into at home. BTW, i'm not sure if it's appropriate to short-circuit the fetching on the first 304 response: does github invalidate all ETags when a single page in the listing changes? Commit: 444bea742210c5421e0479a3b28944b1bc0050b7 https://github.com/yast/yast-meta/commit/444bea742210c5421e0479a3b28944b1bc0... Author: Josef Reidinger <jreidinger@suse.cz> Date: 2014-03-24 (Mon, 24 Mar 2014) Changed paths: M y2m Log Message: ----------- Merge pull request #10 from roman-neuhauser/get_repos-304 get_repos observes 304 Not Modified Compare: https://github.com/yast/yast-meta/compare/3f9c8196ba07...444bea742210
participants (1)
-
GitHub