6f833284cb
This PR was merged into the 3.2-dev branch. Discussion ---------- [Cache] Added PhpFilesAdapter | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This is taking over #18832. With a warm cache I get these numbers consistently (PhpArrayAdapter being the implem in #18823 ): ``` Fetching randomly 5000 items 10000 times: Symfony\Component\Cache\Adapter\FilesystemAdapter: 0.1367, 2 megabytes Symfony\Component\Cache\Adapter\PhpArrayAdapter: 0.0071, 2 megabytes Symfony\Component\Cache\Adapter\PhpFilesAdapter: 0.0389, 2 megabytes Symfony\Component\Cache\Adapter\ApcuAdapter: 0.0361, 2 megabytes ``` This means that the PhpArrayAdapter should be used first, then ApcuAdapter preferred over PhpFilesAdapter, then FilesystemAdapter. This is what AbstractAdapter does here. Also note that to get the cache working, one should stay within the limits defined by the following ini settings: - memory_limit - apc.shm_size - opcache.memory_consumption - opcache.interned_strings_buffer - opcache.max_accelerated_files Commits ------- |
||
---|---|---|
.. | ||
Adapter | ||
Exception | ||
Tests | ||
.gitignore | ||
CacheItem.php | ||
composer.json | ||
DoctrineProvider.php | ||
LICENSE | ||
phpunit.xml.dist | ||
README.md |
Symfony PSR-6 implementation for caching
This component provides a strict PSR-6
implementation for adding cache to your applications. It is designed to have a
low overhead so that caching is fastest. It ships with a few caching adapters
for the most widespread and suited to caching backends. It also provides a
doctrine/cache
proxy adapter to cover more advanced caching needs and a proxy
adapter for greater interoperability between PSR-6 implementations.