[TYPO3-mvc] Caching view parts

Claus Due claus at wildside.dk
Fri Jun 1 17:10:57 CEST 2012


On May 31, 2012, at 11:22 AM, Henjo Hoeksma wrote:

> Is it possible to cache this part of the view (or the relations between the
> objects in this state) ?
> And if so, how could I do this?
> 
> Desperate for an acceptable performance solution!

Hi Henjo,

I have a rather unorthodox method but it could certainly help if your results
are always displaed the same way, i.e. no highlighting or similar changes
on each search.

Write a ViewHelper which is capable of caching all child content and
retrieves the child content if a cached version exists. Use this ViewHelper
around each result in your list and internally in the ViewHelper, identify
each cached item by the result uid or some other, unique string.

Use a simple caching Frontend which just stores strings and any backend
you like; I suspect you will have quite fair performance if you use the standard
DbBackend.

The point is: if your search routines are fast themselves but the display is
what is impairing performance, caching the raw HTML is the absolute best
performance you can get. A FileBackend might be even faster but this would
require 4.6 and that would already mean much improved performance in
Fluid - so the solution I suggest makes most sense on 4.5 and/or if you are
displaying very complicated Model objects but always the same way.

The resulting ViewHelper would actually be easy to make generic and I would
love to include that in FED if you are willing to donate it. Simply allowing to
specify the desired caching identifier would be sufficient.

Hope this helps :)

--
Cheers,
Claus
http://fedext.net



More information about the TYPO3-project-typo3v4mvc mailing list