In order to have a more modular cache system, caching resources should be set in the conf file and matche URIs with patterns (like for router, rights) that can:
allow caching or not,
allow caching under a particular content size only,
allow caching with a custom cache driver (fs, xcache, memcache, apc).
It could look like that:
the URIs matched
cache.+.uri=/db/(._)
# the type of cache used
cache._.type=xcache
# the max file size (ko)
cache._.maxsize=100
# the cache lifetime (s)
cache._.lifetime=3600
cache.+.uri=/http/(._)
cache._.type=fs
cache._.maxsize=100000
cache._.lifetime=0
The main difficulty will be to find a way to register callbacks accross different cache systems. Many solutions:
looking for callback in every cache systems (a bit heavy)
saving callbacks in only 1 cache system and iterate througt it
In order to have a more modular cache system, caching resources should be set in the conf file and matche URIs with patterns (like for router, rights) that can:
It could look like that:
the URIs matched
The main difficulty will be to find a way to register callbacks accross different cache systems. Many solutions: