php-tuf / composer-integration

PHP-TUF Composer Plugin.
7 stars 5 forks source link

Make the static cache persist for the entire life of the PHP process, to reduce HTTP requests for unmodified metadata #120

Closed phenaproxima closed 3 months ago

phenaproxima commented 3 months ago

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 a 304 response code.

phenaproxima commented 3 months ago

@tedbow is on another project, so I'm merging this for now and he will review the changes before the next tag is cut.