This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Cache
Nicolas Grekas 6f833284cb feature #18894 [Cache] Added PhpFilesAdapter (trakos, nicolas-grekas)
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
-------

8983e83 [Cache] Optimize & wire PhpFilesAdapter
14bcd79 [Cache] Added PhpFilesAdapter
2016-06-06 10:10:42 +02:00
..
Adapter feature #18894 [Cache] Added PhpFilesAdapter (trakos, nicolas-grekas) 2016-06-06 10:10:42 +02:00
Exception [Cache] Symfony PSR-6 implementation 2016-01-19 08:02:17 +01:00
Tests feature #18894 [Cache] Added PhpFilesAdapter (trakos, nicolas-grekas) 2016-06-06 10:10:42 +02:00
.gitignore [Cache] Symfony PSR-6 implementation 2016-01-19 08:02:17 +01:00
CacheItem.php [Cache] Minor cleanup 2016-04-27 08:45:20 +02:00
composer.json updated version to 3.2 2016-05-13 13:13:23 -05:00
DoctrineProvider.php [Cache] Add DoctrineProvider, for using PSR-6 pools in Doctrine Cache 2016-04-14 15:55:05 +02:00
LICENSE [Cache] Symfony PSR-6 implementation 2016-01-19 08:02:17 +01:00
phpunit.xml.dist [Cache] Symfony PSR-6 implementation 2016-01-19 08:02:17 +01:00
README.md [Cache] Symfony PSR-6 implementation 2016-01-19 08:02:17 +01:00

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.