[TYPO3-dev] new content object COA_GO - performance - need some advise
Krystian Szymukowicz
t33k.RE.MO.VE at RE.MO.VE.prolabium.com
Wed Apr 8 11:33:06 CEST 2009
Hi
Before I put it into TER I'd like to show you my extension and ask for
some advise how to optimize it as it could be quite helpul ext for everyone.
Extension adds new content object COA_GO. ( go = generate once)
Whats extra in this cObj ?
1. cObj is generated only once (more in details)
2. cache period is supported
3. ajax is supported
Where should you gain most?
It's good for cObj that occurs in the same form at many pages, for example:
a) news LATEST, forum LATEST, etc.
b) menu – the bigger is the more you gain more in speed (ACT can be
simpulated by javascript)
c) search input
d) some footer, tools menu, etc.
And its really easy to use it. See the example [1]:
Simple COA:
temp.a1 = COA
temp.a1 = TEXT
[...]
After conversion to COA_GO
temp.a1 = COA_GO
temp.a1.cache.type = beforeCache_db
temp.a1 = TEXT
[...]
That all!
DETAILS:
There are three types of caching type supported:
1. beforeCache_db
2. afterCache_file
3. ajax_file
==============================
TYPE: "beforeCache_db"
1) cObject is generated once and the used by TYPO3 to generate other pages
2) Example: tt_news LATES with 10 real_url typolinks would render circa
150ms on each generated page. Now it will be generated once and fetched
from cache to build the page.
EXAMPLE as above [1].
====================================
TYPE: "afterCache_file"
1) Its cached to file and fast delivered with file include. The only
computing is to decide if the content expired or not.
2) If cache period expires it will regenerate cached cObjects.
3) content is replaced each time TYPO3 gets the page from cache
(something like EXT_INT but cached to file and with cache period supported)
EXAMPLE:
temp.a1 = COA_GO
temp.a1.cache.type = afterCache_file
temp.a1.cache.period = 30
temp.a1.cache.hash = footer
temp.a1 = TEXT
[...]
Where:
"period" - time in seconds the hash expires
"hash" - unigue name – used in table cache_hash and as filename to write
cached cObject. Choose it with care (means it should be unique and
ready to be used as filename)
==================================
TYPE: "ajax_file"
1) content is fetched using ajax
2) pages can be get from TYPO3 cache with full speed
3) pages can even be generated as static files (fe. nc_staticfilecache)
4) with static files no php_mod is executed so it can be extremly fast
and still deliver dynamic content
EXAMPLE
temp.a1 = COA_GO
temp.a1.cache.type = ajax_file
temp.a1.cache.period = 30
temp.a1.cache.hash = footer
temp.a1 = TEXT
[...]
============================================================
All the three types works and can be tested (but are not optimal as its
beta :) )
Esspecially I would like to ask you for advise how to make regeneration
of the cObject more optimal. Now I fetch the url with no_cache parameter
which I think is not a good idea.
What I would like is to get URL that will regenerate only COA_GO object
that are at the page. The best would be to have possibility to
regenerate only selected COA_GO content objects. There is "hash" param
in COA_GO that can be used to find only "this" COA_GO that sould be
regenerated.
Here is the graphical diagram. Maybe there is some more info.
http://www.prolabium.com/coa_go/coa_go.gif
And the extension to download for testing.
(btw: ajax works now only in firefox, opera and chrome)
http://www.prolabium.com/coa_go/coa_go.zip
I hope you will like it and find some time for testing and giving some
advices.
Later this weekend I will put it on forge and create some more
documentation.
--
grtz
Krystian Szymukowicz
More information about the TYPO3-dev
mailing list