-
Notifications
You must be signed in to change notification settings - Fork 133
Improve performance of MembershipManager #485
Comments
This still needs module maintainer OK. |
I'm very interested in this. I have been looking at the So this would mean we could persistently cache our current static cache, and still guarantee the integrity through the use of the cache tags and contexts? Basically persisting our cache between requests? |
I fact is
Exactly. I will provide a PR as soon I as I'll get some oxygen |
I did profiling on I am not sure if we would gain a lot by caching this, especially since the majority of users will not have 1000+ memberships. It seems like retrieving the cached data would be similarly fast. I did not check the other methods in the membership manager though. Possibly |
In #480 the internal static cache has been replaced by using the
@cache.static
service. This, now, opens the way to double the static caching with persistent caching (database, Redis, etc).All we need is to declare a service, such as:
Then we just need to inject this instead of
@cache.static
and do only some renaming inside MembershipManager.Even not used in core (but tested),
BackendChain
allows retrieving items in cascade. You can add as many backends you want. When getting an item from cache, the service will look first in the first backend (which in our case is memory). If there are items not retrieved from there, will fallback to the next defined backend and so on. All subsequent backends cache is tagged with the same tags, so invalidation will also work nice.The text was updated successfully, but these errors were encountered: