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: Extract LowLevelFrontendInterface
and implement PSR-6 and PSR-16 as cache frontends to be used via Caches.yaml
#3239
base: 9.0
Are you sure you want to change the base?
Conversation
LowLevelFrontendInterface
and implement PSR-6 and PSR-16 cache frontendsLowLevelFrontendInterface
and implement PSR-6 and PSR-16 as cache frontends to be used via Caches.yaml
6109af0
to
ec13193
Compare
Beautiful thanks for preparing this! |
c8d8e1f
to
e309627
Compare
@kitsunet @kdambekalns after stumbling over the limitations of our cache interface again i dug out the old idea of having a more basic cache interface we recntly discussed. Alongside making the use of PSR Caches as easy as any other cache this would allow us to implement caches like https://github.com/sitegeist/Sitegeist.StaleMate directly as a cache frontend which i consider quite valuable. |
e309627
to
0f91ed0
Compare
…PSR-16 cache frontends While Neos had methods to create PSR caches those were seldomly used as they worked quite differently to other caches that were configured via `Caches.yaml`. This change introduces implementations of PSR-6 Cache and PSR-16 SimpleCache that can be used as normal flow cache-frontends. To make this possible the low level functionality of object instantiation and garbage collection and flushing was extracted into a `LowLevelFrontendInterface` while the `FrontenInterface` on to defines the interaction with the caches. The old methods for creating psr caches are deprecated and marked for removal with Neos Flow 10.
0f91ed0
to
d590baa
Compare
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.
Thanks for taking care, would love to get this into 9.0, as written, I think composing our Frontend with a lowlevel one inside might be nicer in the long run :)
But I probably wouldn't block it if that takes too long.
Had a look as promised, my suggestion about composition was 🤦 I just misread what was going on. I don#t think it's necessary, but overall I find the code a bit convoluted now, I wrote up a whole lot here about conceptually splitting the interfaces but however I turn it, there is no beautiful solution with different needs pulling and pushing at this code. Maybe the LowLevelInterface could have a different name ala |
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.
Giving this a preliminary +1 even though comment above applies.
@kitsunet for the psr-frontends it would work to have them as a wrapper around the current frontends. For flexibility i would like to be able to implement frontends with a totally different interface like the closures the symfony cache uses. For that (+ async cache population) i tried the wrapper approach here https://github.com/sitegeist/Sitegeist.StaleMate but this is even more convoluted. That is why i ended here. I did not know how to describe this properly in the pr description. Will add another line to the review instructions. |
If you like I would also try to look in depth into this and give you a full review. But that may take some time and I might have some questions :P (i don't know what to make out of the lowlevel naming). Maybe we can discuss this at the sprint or next Friday? |
While Neos had methods to create PSR caches those were seldomly used as they worked quite differently to other caches that were configured via
Caches.yaml
.This change introduces implementations of PSR-6 Cache and PSR-16 SimpleCache that can be used as normal flow cache-frontends. To make this possible the low level functionality of object instantiation and garbage collection and flushing was extracted into a
LowLevelFrontendInterface
while theFrontenInterface
on to defines the interaction with the caches.Tho help to ensuring which cache interface you are working with the method
getCache
of theCacheManager
now got an optional second argument that allows to specify the classname of the expected frontend implementation.The old methods to create PSR caches are deprecated and marked for removal with Neos Flow 10.
Upgrade instructions
If Caches are configured via Caches.yaml and injected via Objects.yaml no changes are needed.
If the CacheManager is used to obtain certain caches it is important to note that the the method
getCache
now returnsLowLevelFrontendInterface
instead ofFrontendInterface
. It will still return the configured cache implementation fromCaches.yaml
but you may have to add the expected className as second argument to convince your static analysis.Review instructions
A secondary non-official goal of this pr is allowing to implement other cache interfaces like the following as flow cache and be managed by the cache manager.
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions