[TYPO3-UG Hamburg] Na Mensch...

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Thu Sep 28 10:22:17 CEST 2006


Hi Thomas,

was muss ich da sehen?

> .... &no_cache=1

Das darf doch wohl nicht .... Falsches Caching sollte doch längst
Geschichte sein. Ich denke die Usergroups sind dach sowas wie die
Leuttürme in der Community. Etwas woran sich die User orientieren sollen.


<quote JoH>
USER_INT will always be the bottleneck if you are using it many times on
just one page.
Recently I did some testing to speed up the rendering of pages containing
tt_products plugin with various parts (BASKET, LIST, MINIBASKET ...)
The major task was to optimize the way things are rendered from/into the
cache and only prevent those elements form caching that really need dynamic
output for each call and to get rid of set_no_cache().
I just used time() in the different functions to have an overview which
parts are dynamic and which come from the cached page.
The basic concept is having a TS-Setup like this:

plugin.tx_cachetest_pi1 = COA
plugin.tx_cachetest_pi1 {
    10 = TEXT
    10.data = date:U
    10.strftime = %D - %H:%M:%S
    10.wrap = First call:&nbsp;|<br /><br />
    20 = USER
    20 {
        userFunc = tx_cachetest_pi1->main
        userFunc {
            basket = COA_INT
            basket {
                wrap = <hr />|
                10 = TEXT
                10.value = Basket (COA_INT):
                20 = USER
                20.userFunc = tx_cachetest_pi1->callTimeBasket
            }
            singleView = COA
            singleView {
                wrap = <hr />|
                10 = TEXT
                10.value = Single View (COA):
                20 = USER
                20.userFunc = tx_cachetest_pi1->callTimeSingle
            }
            combinedView = COA
            combinedView {
                wrap = <hr />|
                10 = COA
                10 {
                    wrap = |<br />
                    10 = TEXT
                    10.value = CombinedView (COA) Part1 (COA):
                    20 = USER
                    20.userFunc = tx_cachetest_pi1->callTimeCombined1
                }
                20 = COA_INT
                20 {
                    wrap = |<br />
                    10 = TEXT
                    10.value = CombinedView (COA) Part2 (COA_INT):
                    20 = USER
                    20.userFunc = tx_cachetest_pi1->callTimeCombined2
                }
            }
        }
    }
}

As you can see, the functions are always called by a USER object, while the
caching is triggered using COA or COA_INT.
Since the whole setup is handed over to just one function inside the main
USER element, you can use $this->cObj->cObjGetSingle to render the different
parts according to the flexform-/codefield-setup of the plugin.
This way you can break down the whole layout into smaller chunks and render
only the relevant parts dynamically, while including the class only once.

You can see the result here:
http://www.4any1.de/index.php?id=2346&no_cache=1
http://www.4any1.de/index.php?id=2346

Using the adminPanel the difference between the cached and non cached
version is around 100ms (just for calling time() + TEXT element + wrap)
You can imagine the difference for more complex function calls and/or
TS-Setups.

AFAIK Franz Holzinger has already implemented the concept into the new
tt_products version, but I haven't found the time to test the results yet.

Maybe it could be the way to go to have an intelligent combination of TS and
PHP functions to optimize the way extensions are rendering their output.

Joey
</quote>

Siehe auch:

<http://t3flyers.wordpress.com/2006/09/11/a-quick-guide-to-correct-caching-with-pi_base/>

Grüße

Elmar






















More information about the TYPO3-hamburg mailing list