Bug #22842
closedCaching framework: Backport PhpFrontend from FLOW3 and refactor FileBackend
0%
Description
FLOW3 implemented a PHP Cache Frontend which allows for effective caching of PHP code which is included with require_once() instead of runtime parsing with eval(). This significantly improves speed when used in combination with an opcode cache such as APC. Currently only the FileBackend supports PHP code caching.
This patch ports the changes to v4. This is very handy if extensions like extbase decide to implement things like AOP, where PHP code is generated on the fly and needs to be cached effectively.
Sum up of changes:
- Added PhpFrontend class
- Added PhpCapableBackend interface and implemented in FileBackend
- Refactored the FileBackend to use a different storage strategy
- Refactored the FileBackend unit tests.
Important detail:
As far as I can see by now, the new storage strategy leads to very fast set(), get() and require_once() calls (straight usage of btree capabilities in all recent filesystems), while flushByTags() and findIdentifiersByTag() will be slower with many cache entries. Thus, doing a lot of entry invalidation with tons of entries is probably not a good idea with this backend. I'd recommend the DbBackend for content caches (with properly configured mysql) for now and I'll try to come up with some numbers, documentation and use cases if and when MemcachedBackend and FileBackend can catch up.
(issue imported from #M14666)
Files