Jun 30, 2008

How to kill TYPO3 performance from extension

Today I went to check buzz.typo3.org for new articles. I scanned through some when I came across the article named "Dynamic Caching in TYPO3". The article is interesting because it describes unusual techniques related to caching. But author does one "not-so-good" thing. He promotes the use of $TSFE->set_no_cache(). As I said many times, this is evil and should be avoided at all costs! Search for another solution, do whatever tricks but never ever use set_no_cache()! It will kill your web site under any serious load.

It is not a big problem for the particular case described in that article. In the article this function will be used only for a logged-in user who views his own card. But readers may learn about the function and start using it in extensions without realizing what they do. That's bad. We had a problem some time ago in commerce extension, which disabled caching for the whole web site and made the site extremely sloooooooow and created huge load on the server. Bad. Too bad. I wish all writers make a bold warning when mentioning this function: dangerous!

Last week I made a performance review of yet another web site and yet again (again and again!) I found problems caused by misuse of set_no_cache(). It was found in three extensions (download, link list and one proprietary). It is typically the set_no_cache-case when people ask why their site has such a bad performance. If it only were in my power, I would go to TER and remove all extensions that use set_no_cache().

Don't use this function! It is for core only! It is not for you! Avoid at all costs!

No comments:

Post a Comment