[Neos] Issue with content cache

nikos nick at jamalade.com
Thu Jan 29 01:29:30 CET 2015

Unfortunately I am not having much luck with this.

Just as a summary I have a Teaser content node which displays teaser text forcontent eleswhere on the site ie. targetNode.
I have defined a cache directive for the Teaser in TS with entry tags being Node_ and DescendantOf_ the targetNode (as in original posting).

I am using the standard cache setup which is a StringFrontend which uses a FileBackend for the actual cache.

The TypoScript Cache is all set up fine with all my Teaser nodes having coresponding cache files. When the target node(s) or their descendants are 
edited via the backend the Nodes are registered as requiring a change in ContentCacheFlusher->registerNodeChange and the revelant tags are added to 
flush list as expected :)

However when the Cache is flushed via ContentCacheFlusher->shutdownObject the cache file for the Teasers not removed as expected :( Seems that they 
can't be found - I have visual gone through the code in FileBackend to see that the code for saving a cache entry and seraching for it correspond and 
they look ok.

I can't really tell what is actually happening in the Filebackend, which is doing all the work, as I have not been able to debug at that level (I 
haven't had much luck with xDebug, Neos & Netbeans) but using AOP where I can I have logged what's been happening. However this doesn't work for 
FileBackend as it and all it's super classes have Proxy(false).

I am wondering if anyone has any ideas of what might be going wrong here, or suggestions as to how I could more effectively debug this area of Neos so 
I can get to the bottom of this.

Many thanks


On 22/01/2015 17:10, nikos wrote:
> Hi all
> I have a slight issue with the content cache and can't figure out if I have missed something or there is a bug somewhere.
> I have a content node  which displays teaser's from other nodes, the target nodes, on the site.
> Everything displays well, but I noticed that when the target nodes content is edited the teaser is not refreshed to reflect this.
> So i thought i should add some cache directives to my teaser typoscript like so (included in full)
> prototype(Reroot.RerootSiteCom:SectionTeaser) < prototype(TYPO3.Neos:Content){
>      templatePath = 'resource://Reroot.RerootSiteCom/Private/Templates/NodeTypes/SectionTeaser.html'
>      node = ${node}
>      attributes.class = 'teaser-element'
>      attributes.class. at process.1 = ${value + ' clearfix'}
> ## the @override pushes this variable onto the context
>      @override.teaserTargetNode=${q(node).property('teaserTargetNode')}
>      parentNode= ${q(teaserTargetNode).parents('[instanceof TYPO3.Neos.NodeTypes:Page]').first().get(0)}
>      teaserHeadline=${q(teaserTargetNode).children('column0').children('[instanceof TYPO3.Neos.NodeTypes:Headline]').first().property('title')}
>      teaserText=${q(teaserTargetNode).children('column0').children('[instanceof TYPO3.Neos.NodeTypes:Text]').first().property('text')}
>     @cache {
>                  mode = 'cached'
>                  maximumLifetime = '86400'
>                  entryIdentifier {
>                          node = ${node}
>                          domain = ${site.context.currentDomain}
>                  }
>                  entryTags {
>                          1 = ${'DecendantOf_' + teaserTargetNode.identifier}
>                          2 = ${'Node_' + teaserTargetNode.identifier}
>                  }
>          }
> }
> my expectation, given the entryTags as above, that if the targetNode or its descendants are modified then the cache for the teaser would be refreshed
> and so reflect the changes. This isn't the case. So I am wondering if
> 1) I am looking at this too simplistically (probably am)
> 2) there is an error in the above
> 3) there is a bug with caching.
> Ideas as gratefully appreciated.
> Warm wishes
> Nikos

More information about the Neos mailing list