neos-development-collection icon indicating copy to clipboard operation
neos-development-collection copied to clipboard

TASK: Content cache adjustments

Open nezaniel opened this issue 2 years ago • 4 comments

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

  • [x] Code follows the PSR-2 coding style
  • [x] Tests have been created, run and adjusted as needed
  • [x] The PR is created against the lowest maintained branch
  • [ ] Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • [ ] Reviewer - The first section explains the change briefly for change-logs
  • [ ] Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

nezaniel avatar Oct 21 '23 14:10 nezaniel

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?

kitsunet avatar Oct 22 '23 21:10 kitsunet

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.

kitsunet avatar Oct 23 '23 10:10 kitsunet

@bwaidelich yes, let's do this together... I have quite some ideas for improvements, including CacheTag VOs, Unit tests etc.

nezaniel avatar Oct 23 '23 17:10 nezaniel

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 ContentCacheFlusher is probably necessary.

I know that having an interface is more fancy but still, objects yaml exists and the ContentCacheFlusher is not final. So for your experimental usecase i would suggest to go down the road of extending the flusher and adding functionality and then for every place it is used use Objects.yaml to use your implementation as constructor argument.

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...

mhsdesign avatar Feb 15 '24 09:02 mhsdesign

@nezaniel Is the interface still relevant?

flushes caches for deleted nodes, not just their parents

This is fixed by #5175

dlubitz avatar Sep 02 '24 19:09 dlubitz

I think this can be closed, I've opted for AOP to solve this in the ComponentView for now.

nezaniel avatar Sep 10 '24 15:09 nezaniel