-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
TASK: Content cache adjustments #4636
Conversation
Co-authored-by: Marc Henry Schultz <85400359+mhsdesign@users.noreply.github.com>
Isn't the point of this to be not internal in order for people to use this? I guess fine for a start but this is supposed to become API right? |
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.
Sorry for the -1, but I'm really skeptical about this (as mentioned on Slack).
IMO we suffer from Interface-itis in the "old" Neos code base. I like interfaces but they should have a very clear role and in this case it is not evident to me.
i.e. What is an implementation of flushNodeAggregate
supposed to do? (the name of this method is rather unfortunate IMO – not a new issue of this PR, but extracting it to an interface makes it more prominent)
Why are assets part of the deal and not other entities?
My main concern is, that this introduces another global point of replacement by using Objects.yaml
– but changing the ContentCacheFlusherInterface
implementation could break implementations that rely on the current content cache behavior..
Long story short:
I think it's a good idea to allow for 3rd parties to hook into the "content cache flushing" but IMO that should not be in the form of an adapter pattern but rather some kind of extension/hook/callback.
Probably the easiest solution would be some option for the GraphProjectorCatchUpHookForCacheFlushing
that allows for registering custom code to be executed on a per CR basis.
Again, sorry for stepping on the brakes once again.. I'm happy to discuss this and come up with a solution together
Good points, maybe we need an idea of projected use cases? I can see a point of getting informed when content caches are flushed and a case of being informed when the projections changed, but both could be done differntly, but overwriting the cache flushing in itself? Thinking about it I agree this might be the "wrong" extension point. |
I removed the -1 because I don't want to block this, but I would still suggest to change the implementation slightly and I'm happy to help with that
@bwaidelich yes, let's do this together... I have quite some ideas for improvements, including CacheTag VOs, Unit tests etc. |
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.
LGTM, but yes, an internal interface won't help much, so either way, if we want to merge this, I am fine, but I could also see room for something nicer.
I think a interface like this to replace cache flushing is also bad practice, if we were to make this an extension point we would need some kind of chain where we can hook multiple flushers, as the I know that having an interface is more fancy but still, objects yaml exists and the That would make in my head much more sense at this stage. We as core devs have a little perk of being able to easily add what we want... |
$this->scheduleCacheFlushJobForNodeAggregate( | ||
$this->contentRepository, | ||
$nodeAggregate->contentStreamId, | ||
$nodeAggregate->nodeAggregateId | ||
); |
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.
still this part seems to be a bugfix that we want to preserve?
I think this can be closed, I've opted for AOP to solve this in the ComponentView for now. |
This adds an interface for other content caches than Neos' Fusion content cache.
Also flushes caches for deleted nodes, not just their parents, in case they or their types were used in CacheTags elsewhere
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions