Added some documentation about caching

This commit is contained in:
Jan Böhmer 2023-07-17 23:25:22 +02:00
parent 52c6884e28
commit 0577f9e166

View file

@ -85,4 +85,12 @@ Following env configuration options are available:
To create a custom provider, you have to create a new class implementing the `InfoProviderInterface` interface. As long as it is a valid Symfony service, it will be automatically loaded and can be used. To create a custom provider, you have to create a new class implementing the `InfoProviderInterface` interface. As long as it is a valid Symfony service, it will be automatically loaded and can be used.
Besides some metadata functions, you have to implement the `searchByKeyword()` and `getDetails()` functions, which do the actual API requests and return the information to Part-DB. Besides some metadata functions, you have to implement the `searchByKeyword()` and `getDetails()` functions, which do the actual API requests and return the information to Part-DB.
See the existing providers for examples. See the existing providers for examples.
If you created a new provider, feel free to create a pull request to add it to the Part-DB core. If you created a new provider, feel free to create a pull request to add it to the Part-DB core.
## Result caching
To reduce the number of API calls against the providers, the results are cached:
* The search results (exact search term) are cached for 7 days
* The product details are cached for 4 days
If you need a fresh result, you can clear the cache by running `php .\bin\console cache:pool:clear info_provider.cache` on the command line.
The default `php bin/console cache:clear` also clears the result cache, as it clears all caches.