-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Pass tags to be flushed to content cache backend #3631
Conversation
Instead of calling the cache backend for each tag to flush individually, the list of tags is passed to the backend with the newly introduced `flushByTags` method in neos/flow-development-collection#2718. This allows each type of backend to optimise the flushing of all tags, which can lead to huge performance improvements. Especially when content is published to the live workspace which leads to large numbers of cache tags that will be flushed.
The messages stored with individual content cache tags take up a lot of unnecessary memory in production context and not are even used there. With this change the behaviour can be enabled via the setting `Neos.Neos.fusion.contentCacheDebugMode`.
11543a8
to
910af10
Compare
This helps when trying to use AOP to influence caching behaviour. The RouteCacheFlusher does it the same way.
This can speed up flushes after publishing a lot if a lot of document nodes are affected by the published changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works and makes sense.
One thing that could be added would be to enable the debugMode in development context by default.
The tests can only turn green with neos/flow-development-collection#2718 merged into flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about enabling debug mode in development context by default?
Co-authored-by: Karsten Dambekalns <karsten@dambekalns.de>
I think inspecting the atomic cache debug output is a very specific use case, IMO this should be left disabled until needed. |
I agree to the argument of @Sebobo that not every flushed tag should be logged even in dev-mode. It can be enabled for debugging caches but other than that i is a risk of covering up important log messages. |
What I did
Instead of calling the cache backend for each tag to flush
individually, the list of tags is passed to the backend with
the newly introduced
flushByTags
method inneos/flow-development-collection#2718.
This allows each type of backend to optimise the flushing
of all tags, which can lead to huge performance improvements.
Especially when content is published to the live workspace
which leads to large numbers of cache tags that will be flushed.
Also the messages stored with individual content cache tags
take up a lot of unnecessary memory in production
context and not are even used there.
With this change the behaviour can be enabled via
the setting
Neos.Neos.fusion.contentCacheDebugMode
.Resolves: #3640
How I did it
The
ContentCacheFlusher
now calls theflushByTags
method introduced in neos/flow-development-collection#2718.Only in the newly introduced debug mode the old style of flushing by tag individually is used to provide the individual logged feedback why entries were flushed.
How to verify it
Checklist