[Neos] Issue with content cache

nikos nick at jamalade.com
Thu Jan 29 14:32:45 CET 2015


OK I resolved the issue - rather embarrassingly it was a typo in my TS I had DecendantOf rather than DescendantOf in my cache settings- a time costly 
typo.

The upside is that I now know the cacheing mechanism pretty well and got to put into practice some AOP to do some debugging!

I am wondering if the allowable Neos TS Cache entry tags should be validated somewhere? Not sure quite where it would fit in the cache architecture as 
the only place at the moment where the tags are known is in TYPO3\Neos\TypoScript\Cache\ContentCacheFlusher. Perhaps something to ponder on.

I have noticed that the biggest source of errors - at least for me - is in the configuration where typo's or misspellings are hard to trace.


Anyway happy again and have learnt something new :)

Nikos



On 29/01/2015 10:23, nikos wrote:
> Just upgraded from Neos 1.2.0 1.2.1 but problem still there :(
>
>
>
> On 29/01/2015 00:29, nikos wrote:
>> 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
>>
>> Nikos
>>
>>
>> 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