[TYPO3-mvc] Extbase objects caching
bernd wilke
t3ng at bernd-wilke.net
Mon Jun 2 16:19:26 CEST 2014
Am 02.06.14 14:10, schrieb Viktor Livakivskyi:
> Hi, Bernd.
>
>> just apply the selection after display with javascript.
>> either javascript gets the selection from cookie or from uncached JS
>> added to the end of the page.
>
> Yes, this is also an option, but let's imagine a situation, when I neend
> to show a product-preview icon near it's name (from a field "preview").
> And currently selected product should show different icon (from a field
> "preview_current") and output other fields, relevant to current product
> (description, features (which are in m:n relation) with links to each
> feature and so on).
> To make it work JS way would mean, that I need to render all of that
> data for each product on first hit and hide/unhide with JS, which sounds
> more like hack, than a solution. And also increases page load time of
> first hit, since we can no longer use lazy-load for heavy entities.
>
> More ellegant way from my point of view is to have cache on repository
> or query level, rather than on presentation level, since objects remain
> same, but presentation changes.
I don't want to say that this is always the solution. but with a little
effort (in programming) it is possible to cache the big data and only a
few data is uncached. And all this without a (big) penalty in time and
transfer volume.
in your scenery it would be possible to load individualization and
additional information afterwards per AJAX (lazy load) and insert it
into the big (still cachable) list. ;-)
with lazy loading only elements which are visible in the current
viewport you may save a lot of traffic if your base data is much bigger
than one screen, or visible only on mouseover or similar events.
bernd
--
http://www.pi-phi.de/cheatsheet.html
More information about the TYPO3-project-typo3v4mvc
mailing list