Feature #60181

Caching mechanism for Fluid Views/Templates

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

Status:
New
Priority:
Could have
Assignee:
-
Category:
View
Target version:
-
Start date:
2014-07-08
Due date:
% Done:

0%

Estimated time:
Has patch:
No

Description

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

Actions

No data to display

Also available in: Atom PDF