ampproject / amp-toolbox-php

AMP Optimizer PHP library
Apache License 2.0
73 stars 25 forks source link

Add TemporaryFileCachedRemoteGetRequest to cache cURL request #414

Closed ediamin closed 2 years ago

ediamin commented 3 years ago

This PR added a temporary file cache system to cache the remote request response. This will improve the performance issue described in issue #292.

ediamin commented 3 years ago

@schlessera Need your suggestions to add the test cases for TemporaryFileCachedRemoteGetRequest. I'm not sure what would be the best way to write tests to handle the file_get_contents and file_put_contents methods.

schlessera commented 3 years ago

I'm not sure what would be the best way to write tests to handle the file_get_contents and file_put_contents methods.

Filesystem-based manipulations can be tested in an easy way with https://github.com/bovigo/vfsStream.

ediamin commented 3 years ago

@schlessera Updated the PR with test cases. Please take a look.