[TYPO3-dev] set_no_cache is bad. What's next?
JoH asenau
info at cybercraft.de
Fri Oct 30 19:00:00 CET 2009
>>> But normally the biggest part is never changed and could be a USER
>>> object. This is e.g. the single view of a product. Then there is
>>> only a small dynamic part which changes frequently and cannot be
>>> cached: e.g. the current amount of items in the basket for this FE
>>> user.
>>
>> Make it into a separate plugin.
>
> Do you mean, that it is better to have 2 plugins for single view, one
> allowing to show the amount of items in the basket and being a
> USER_INT, and another one which is USER and which does not allow to
> show this user dependant number? Is a USER_INT faster than if I used
> an internal USER_INT for each view of the amount (list view has
> multiple products and amounts, single view has exactly one amount
> number) and USER for the whole plugin?
Well - I would prefer: Use a separate function/method not a completely
separate plugin.
As we already agreed on a singleview of a product can be cached, since it
doesn't change very often.
If there is a small part which is user related and should not be cached, the
single view should work like this:
shopsystem = USER
shopsystem {
userFunc = shopsystem->main
singleView = COA
singleView {
wrap = blah|blah
10 = TEMPLATE
10 {
template = FILE
template {
file = blah
marks {
something = TEXT
something.field = whatever
somethingelse = IMAGE
somethingelse.field = whatever
basket = USER_INT
basket {
# not sure about this one
# should be tested with and without it
# includeLibs = blah
userFunc = shopsystem->basketfunction
basketSettings = COA
basketSettings {
# blah
}
}
}
}
}
}
}
The COA makes sure, the admin user can add other stuff easily.
The TEMPLATE makes it easy to adjust the layout.
The USER_INT inserts the dynamic part (and can of course use a TEMPLATE as
well)
The main plugin just has to call cObjGetSingle for the each view and that's
it.
IMHO this is how most of the extensions should be working and this is how
tt_products, tt_news and the like could be tuned to work much faster than
they currently do.
Just my 2 cents
Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
More information about the TYPO3-dev
mailing list