BUGFIX: Adapt cache flushing to Neos 9 cache flushing#27
Conversation
There was a problem hiding this comment.
According to the composer.json the package still supports Neos 8.0 and 9.0. That is why we probably should intercept the following methods of the ContentCacheFlusher:
addTagToFlush(with a deprecation notice for removal after 8.x support is dropped)flushTagsImmediatelycollectTagsForFlushOnShutdown
AFAIK the aspects react gracefully when a join point does not match so we still can support Neos 8 and 9 from a single version of FullPageCache.
|
Hmm, but this will not work. The point in time when the tags are actually get flushed have changed. In Neos 8 it was always on shutdown. In Neos 9 its either immediate OR on shutdown. If we do not match this, it could lead to unwanted cache entries (re-written cache with outdated data). I would prefer to make it easy and make this version Neos 9 only. But we could make it downwards compatible by checking if the property "tagsToFlush" exists within the "onShutdown" aspect. |
|
Looked again and you are right. The single aspect on For Neos 8 i suggest to keep the code as previously implemented but use the |
|
Hmmm ... if the ContentCacheFlusher would trigger a signal for the flushed tags we could get rid of the aspect entirely. That would make sense api wise as this is also needed by Varnish or CloudFlare adapters. The last thing that would need a "proper" solution then would be the extraction of cache metadata that is currently done by the metadataAwareStringFrontend which does weird things to work around the fact that during reading we have no way to get the remaining lifetime and tags of a cache item. |
|
Yes, the signal would make sence, but would also be a breaking change and only work for 9.0, right? |
|
yap ... and also it only makes sense with a way to get the needed metadata from the FusionContentCache in a clean way (Probably also via Signal) and not by adding a custom cache-frontend. Probably way too late for 9.0 maybe we can introduce the needed apis in 9.1. |
|
Ok, I'll adapt this PR accordingly. |
|
@mficzel Done. Woul be great if you can test it with a Neos 8 instance. |
mficzel
left a comment
There was a problem hiding this comment.
Looks fine and i can confirm that the tag-flushing still works in Neos 8 (tested 8.3)
Fixes #26