[TYPO3-mvc] Extbase / ViewHelper disable caching?
Helmut Hummel
helmut.hummel at typo3.org
Wed Aug 20 15:14:52 CEST 2014
Hi!
On 14.09.12 12:12, Claus Due wrote:
> A cached output does not render the ViewHelpers every time, it stores HTML already built. This is why you must use USER_INT to make the template render every time. You can make chunks of cached output inside an uncached extension but not the other way around. If the parent is cached then the child is not asked to render.
>
> The solution is to use USER_INT and manually cache the parts you want cached. The other way is backwards ;)
Not entirely true ;)
Marking the plugin as USER_INT will not render the plugin in the first
place. Instead a placeholder is rendered and the HTML of the page is
cached with this placeholder.
If during rendering of the page TYPO3 finds such a placeholder, it calls
the original plugin and replaces the placeholder with the actual plugin
output.
The same technique is used for rendering a COA_INT TypoScript content
object.
Using this knowledge to our advantage one could use the <f:cObj> view
helper in template of a completely cached plugin. If the TypoScript path
points to a COA_INT (or USER_INT) object, then this COA_INT will be
rendered on every request, despite the rest of the plugin output being
cached.
Building upon that, it would be possible to create a VH that is rendered
uncached, although it would be hard to pass the current rendering
context (variables for instance) to the child view helpers without
rendering the parent template again. Not entirely impossible though.
Kind regards,
Helmut
--
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 Core Developer, TYPO3 Security Team Member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-project-typo3v4mvc
mailing list