[TYPO3-dev] Apache/PHP TYPO3 Caching-Module

Christian Kuhn lolli at schwarzbu.ch
Sun Mar 21 13:35:15 CET 2010


Hey,

Jigal van Hemert wrote:
> Thanks for the suggestion! Unfortunately the current handling of _INT 
> plugins is so slow that caching inside the plugin will not add 
> significantly to the speed of displaying _INT plugins in a page (unless 
> the extension itself is so incredibly slow).

We experienced the following behavior:
A fully cached page on a reasonable system takes around 20ms to render. 
Adding just one "hello world" _INT plugin at least tripples the 
parsetime to 60ms or more. A non-cached page takes 300ms, or longer if 
there are complex plugins.

When do you really need _INT plugins? Usually only for stuff like login 
forms (where the form could be USER, the form action should then 
redirect to a login page with _INT to handle the action). Many other 
plugins that display always changing data could on the other hand always 
be a cached USER, if their lifetime is short enough, or if the cache 
clearing for this element is configured.

We decided to go this way for a complex site with tons of plugins:
- Use no _INT plugins at all on main pages, so if a page is cached it 
always renders in around 20ms.
- Use enetcache for all plugins with complex parsings, set low lifetimes 
(eg. 15min) for plugins that need to quickly catch up with data changes 
(eg. hotlists like mostclicked). Set high lifetimes for other plugins 
and invalidate the cache entries on change (eg. news list / detail pages).
- If we really need current, maybe user specific data to display: Cache 
the pages and the plugins (no _INT again) and get the missing data with 
a quick eID script.

This way we are able to realize the following scenario: A page is 
usually delivered fully from page cache. If the lifetime of a plugin 
expired, the page cache and this plugin element cache is invalid, so the 
page is rendered again, meaning all other plugins are delivered from 
content element cache and only this single plugin with expired cache 
needs to be re-rendered.
This is much more useful for pages with many clicks because you don't 
get the overhead of _INT for every click, but usually deliver the page 
fully from cache, and need to render the full page only if some plugin 
cache expired.

Rough calculation:
1. 60ms for a page with a _INT for every click
2. 20 ms for a fully cache page without _INT, but 400ms every 15 minutes
--> If you have more than 10 clicks to a page in 15 minutes, the second 
solution is less cpu intensive.

With enetcache it's even possible to share plugin content element cache 
entries between pages, so if one page renders a content element and a 
second page displays the same element, the cache entry can be re-used. 
Just imagine how much you gain if you have a news detail page with a 
hotlist that is shared on all detail pages ...


Just my 2 cents
Christian




More information about the TYPO3-dev mailing list