#SymfonyCon @nicolasgrekas
• A common interface for basic and
intermediate-level caching needs.
• Allow for multiple independent extensions
without collision.
PSR-6 Goals
Slide 9
Slide 9 text
#SymfonyCon @nicolasgrekas
• Compatibility with all existing cache
implementations.
• Advanced caching features such as
namespacing or tagging.
PSR-6 Non-Goals
#SymfonyCon @nicolasgrekas
• getItem is the only standardized item factory
• Keys cannot use reserved chars
• false is returned on backend-errors
• Atomicity/transactions/laziness is unspecified
• Cache items are not interoperable
PSR-6 Edge-cases
Slide 16
Slide 16 text
#SymfonyCon @nicolasgrekas
• See on Packagist
https://packagist.org/providers/psr/cache-implementation
• Stash PHP – stashphp.com
• PHP Cache – php-cache.com
• and …
PSR-6 Implementations
Slide 17
Slide 17 text
Symfony Cache 3.1
What else?
Slide 18
Slide 18 text
#SymfonyCon @nicolasgrekas
• Be the most powerful PHP caching library
• A strict PSR-6 implementation
• Following Symfony’s quality processes*
• Just the bare minimum to be fast by default
* thank you Tobias for "cache/integration-tests“!
Symfony Cache Goals in 3.1
Slide 19
Slide 19 text
#SymfonyCon @nicolasgrekas
• ApcuAdapter
• ArrayAdapter
• FilesystemAdapter
• RedisAdapter
• …it’s up to you to add more
Base Symfony Cache Adapters
#SymfonyCon @nicolasgrekas
• « cache.app » for model-sourced items
o Defaults to filesystem, change it to Redis
• « cache.system » for code-sourced items
o Defaults to APCu+filesystem chain
Existing Cache Pool Services
#SymfonyCon @nicolasgrekas
./bin/console cache:pool:clear my_app.geocoder.cache
New in Symfony 3.2
Slide 34
Slide 34 text
#SymfonyCon @nicolasgrekas
• PdoAdapter works for Doctrine DBAL
• PhpArrayAdapter one big PHP 7 static array in shm
• PhpFileAdapter many small PHP 7 static array in shm
• NullAdapter pro-tip: item factory for any Symfony adapters
New in Symfony 3.2
Slide 35
Slide 35 text
#SymfonyCon @nicolasgrekas
• cache.system = PHP7 array > APCu > files
• Offline cache warm-ups for derived
cache.validator/serializer/annotations
Note: APCu warmup & reset handled properly
New in Symfony 3.2
Slide 36
Slide 36 text
#SymfonyCon @nicolasgrekas
• Tags based invalidation
New in Symfony 3.2
Slide 37
Slide 37 text
#SymfonyCon @nicolasgrekas
Tags based invalidation
Slide 38
Slide 38 text
#SymfonyCon @nicolasgrekas
Tags based invalidation
Slide 39
Slide 39 text
#SymfonyCon @nicolasgrekas
• Serve stale items while refreshing?
• Desynchronized Cache Misses?
• Add a profiler panel with cache stats?
• PSR-16 SimpleCache?
• …add your ideas here
Symfony 3.3?