Feature #60181

Caching mechanism for Fluid Views/Templates

Added by Kevin Fischer over 7 years ago. Updated over 7 years ago.

Could have
Target version:
Start date:
Due date:
% Done:


Estimated time:
Has patch:


It would be nice to have have a way to tell Fluid to cache the result of a getter or ViewHelper. This could be done e.g. by prefixing the expression with a $, a similiar special character or otherwise indicating that Fluid should cache this expression:

Won't cache: {object.myComplexGetter}
Will cache: {$ object.myComplexGetter}
Uncached: {object.myComplexGetter}
Cached: {$ object.myComplexGetter}
Won't cache: {acme:time.consuming()}
Will cache: {$ acme:time.consuming()}
Uncached: {acme:time.consuming()}
Cached: {$ acme:time.consuming()}

The cache would operate on a per-file basis, as caching across multiple (independent) template and partial files could raise unforeseen issues and hard-to-debug errors.

The cache would only care about the first part of an expression chain. All subsquent parts of a chain would be executed normally. To avoid running a long or time consuming expression more than once, you could still use the <f:alias> ViewHelper.

Will cache: {$ object.myComplexGetter}
Uses cached result: {$ object.myComplexGetter -> f:count()}

Uses cached result, with the time consuming VH being executed every time:
{$ object.myComplexGetter -> acme:time.consuming()}

I'd love to hear ideas and comments about this. Currently I'm using lots <f:alias> in my code to accomplish this and I'd love to avoid it where possible.

A related feature request for ViewHelpers from someone else: http://forge.typo3.org/issues/3291

Related issues

Related to TYPO3.Fluid - Feature #3291: Cacheable viewhelpersNeeds Feedback2009-05-14


No data to display

Also available in: Atom PDF