-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADD caching support using WP transient API as exposed from WP-CLI #7
Conversation
I like the idea of caching. A developer of wpvulndb.com told me that a limit of 30 calls every 30 seconds is acceptable. However, to keep things simple I would suggest to disable caching by default, this way we have more control (e.g. during development this is cumbersome when one needs to clear the cache to check for new values when updates are done). So adding an option like: --caching | protects from lockouts on wpvulndb.com (max 30 calls/30 seconds) by caching results would be better I think, unless I'm missing something here. Are there any ideas to suggest otherwise? |
Well, no problem in adding a switch. What is indeed cached is the call to wpvulndb.com (for eight hours and I don't know how much often is updated) not the version checking. |
BTW in the pipeline (zipangotes/wp-sec@2b9d090) there is the fix for the behat JSON testing. |
Would this caching be able to be shared between users. We already do this with the download cache in wp-cli by setting the WP_CLI_CACHE_DIR to a shared folder. It would be great if we could do the same with this and result in a lot less calls to wpvulndb. Thank you for this and all your hard work with it. |
Uhm, it would be possible by implementing the caching in the |
In the But indeed I found this on CoreUpgrader.php an implementation of the cache system related to the So it could be something like:
Any thoughts @dogsbody ? |
BTW using WP_CLI\Utils\http_request would remove the dependency on |
Agreed to loose the Guzzle dependency and to use the http_request() by WP_CLI. Advantages I see:
|
This should work: zipangotes/wp-sec@c2c4989 |
I guess this is the simplest solution even though adding a caching layer to guzzle client maybe would be a more sound solution as the WP-CLI caching is "site" based.