On Travis, serve Github update check requests from cache#1618
On Travis, serve Github update check requests from cache#1618danielbachhuber merged 2 commits intomasterfrom
Conversation
This will prevent us from hitting the API request rate-limiting. When `WP_CLI_REQUESTS_CACHE_DIR` environment variable is set, check to see if a cached version of the request is available from the static file cache. If the cached version is available, serve it. If it's not available, do the request and stash it in the cache. Ideally, we'd be injecting our own `Requests_Transport` class, but `Requests` doesn't easily support this.
Would |
|
I looked at |
Sounds like we need a priority argument for the transports. In this specific case, could you set |
If this is run twice, we'll get a duplicate subdirectory. But, it doesn't cause any problems
|
I'm going with this PR to start, as this is an immediate problem we need to solve. |
On Travis, serve Github update check requests from cache
This will prevent us from hitting the API request rate-limiting.
When
WP_CLI_REQUESTS_CACHE_DIRenvironment variable is set, check tosee if a cached version of the request is available from the static file
cache. If the cached version is available, serve it. If it's not
available, do the request and stash it in the cache.
Ideally, we'd be injecting our own
Requests_Transportclass, butRequestsdoesn't easily support this.See #1612