[TYPO3-core] FYI24: #14666: Caching framework: Backport PhpFrontend from FLOW3 and refactor FileBackend

Christian Kuhn lolli at schwarzbu.ch
Wed Jun 9 03:44:28 CEST 2010


Attached patch will be committed in 24 hours if nobody vetoes.

Type: Feature (got OK from Benni)

Branches: trunk

BT: http://bugs.typo3.org/view.php?id=14666

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 or core decides 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.

Regards
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 14666_01.diff
Type: text/x-patch
Size: 65612 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100609/3c5b43a2/attachment-0001.bin>


More information about the TYPO3-team-core mailing list