Use Symfony HttpCache#156
Conversation
| $store = new Store($path); | ||
| $httpClient = new CachingHttpClient($httpClient, $store, ['default_ttl' => 3600, 'allow_revalidate' => true, 'debug' => getenv('APP_DEBUG')]); | ||
|
|
||
| $client->setHttpClient(new HttplugClient($httpClient)); |
There was a problem hiding this comment.
When I try to import using your PR, I get this error:
In AkeneoPimClientBuilder.php line 103:
[TypeError]
Akeneo\Pim\ApiClient\AkeneoPimClientBuilder::setHttpClient(): Argument #1 ($httpClient) must be of type Akeneo\Pim\ApiClient\Client\ClientInterface, Symfony\Component\HttpClient\H
ttplugClient given, called in /SyliusAkeneoPlugin/src/Client/ClientFactory.php on line 47
There was a problem hiding this comment.
Oh, maybe akeneo, change the contact since my pr is open ... @TheGrimmChester
There was a problem hiding this comment.
I confirm... Akeneo change that :
There was a problem hiding this comment.
I think we can use the integrated akeneo cache system that creates a CachedResourceClient object to store resources.
$client = new AkeneoPimClientBuilder($apiConnection->getBaseUrl());
$client->enableCache();
There was a problem hiding this comment.
I think is not a good idea, because he use memory cache, and if you have some data, you risk to throw memory limit.
With my system, cache use is file system.
There was a problem hiding this comment.
thanks @baiiko. We will check if we have to block the 11.3.0 version to benefits from the possibility to implement caching as you did. I think we should provide a way to store it to different places (like redis...) to be able to use the same cache if we are working on multiple server nodes to process the queue.
There was a problem hiding this comment.
Actually, is not possible, CachingHttpClient use only file system.
I use this system with your plugin and my process work faster than standard process.
There was a problem hiding this comment.
You can talk with @oallain if necessary, he can talk with me directly :)
Hi people,
To most performances, i use Symfony HttpCache go put in cache some call.
It's very interesting for some parallel batch :)