[TYPO3-english] Do not cache part of Fluid template. How to?
invisible.kinder at gmail.com
Mon Nov 4 16:21:02 CET 2013
Some time ago a feature request  was opened on Forge to allow enabling/disabling of cache for individual Fluid partials. Request was abandoned and closed. Okay, I can leave with this, but, please, explain me, how can I, i.e., output current logged in user's name and email in Fluid?
I've tried following:
1. Easy mode. Just pass them via assign. Fails, because TYPO3 page's cache stores complete page for whole "Registered" usergroup.
2. Normal mode. Extract dynamic parts to a partial and pass different arguments to it from within template (username, email, timestamp). Fails for same reason.
3. Hard mode. Create extension, plugin, controller and non-cacheable action. Call it via v:render.request . No luck...
4. Nightmare mode. Same as item 3, but additionaly create:
lib.noCache = COA
lib.noCache.pageHeader = USER
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = Smitemplates
extensionName = SmiTemplates
controller = NoCache
vendorName = Vendor
action = pageHeader
1 = pageHeader
settings =< plugin.tx_smitemplates.settings
persistence =< plugin.tx_smitemplates.persistence
view =< plugin.tx_smitemplates.view
update =< plugin.tx_smitemplates.update
Call it in template, like:
<f:cObject typoscriptObjectPath="lib.noCache.pageHeader" />
And assign in controller:
But, as you may have noticed, it is too non-intuitive way. Moreover, if I need some variable, that available in template, how can I bypass it to this non-cacheable controller then?
Maybe, I dig into wrong way and someone else knows better solution?
More information about the TYPO3-english