Make the static cache persist for the entire life of the PHP process, to reduce HTTP requests for unmodified metadata #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey, look! I found a way to reduce the number of network requests we make. :) This makes the static cache loader more aggressive, and persists it for the entire life of the PHP process, regardless of how often Composer decides to reset itself internally.
Testing with
php-tuf/drupal-project
doesn't show a major performance difference, but this definitely reduces the amount of network-bound I/O, which is certainly good. You can tell by comparing the logs -- testing against this branch, you'll see far fewer requests for TUF metadata that return a304
response code.