Centralize CollectionCacheKey instantiation and make it easy to override #6991

Open
opened 2026-01-22 15:42:42 +01:00 by admin · 2 comments
Owner

Originally created by @umpirsky on GitHub (Jun 14, 2022).

Feature Request

Q A
New Feature no
RFC no
BC Break no

Summary

There are cases when running different PHP versions, or caching library versions on different servers (multi server environment). This is during the upgrades when you need to update servers one by one. And they are sharing the same cache, which sometimes lead to incompatibility issues.

In this case, it is beneficial to be able to separate caches (cache keys) depending on the PHP version or whatever you find important and conflicting.

If we look at new CollectionCacheKey instantiation, we can see that it's spread across multiple services which makes it hard to override.

Do you think this is something that is worth centralizing, or there are smarter approaches to separating this caches?

Thanks.

Originally created by @umpirsky on GitHub (Jun 14, 2022). ### Feature Request | Q | A |------------ | ------ | New Feature | no | RFC | no | BC Break | no #### Summary There are cases when running different PHP versions, or caching library versions on different servers (multi server environment). This is during the upgrades when you need to update servers one by one. And they are sharing the same cache, which sometimes lead to incompatibility issues. In this case, it is beneficial to be able to separate caches (cache keys) depending on the PHP version or whatever you find important and conflicting. If we look at [new CollectionCacheKey](https://github.com/doctrine/orm/search?q=new+CollectionCacheKey) instantiation, we can see that it's spread across multiple services which makes it hard to override. Do you think this is something that is worth centralizing, or there are smarter approaches to separating this caches? Thanks.
Author
Owner

@derrabus commented on GitHub (Jun 14, 2022):

And they are sharing the same cache

Should they though?

@derrabus commented on GitHub (Jun 14, 2022): > And they are sharing the same cache Should they though?
Author
Owner

@umpirsky commented on GitHub (Jun 14, 2022):

Other then during migration times, it makes sense to share.

@umpirsky commented on GitHub (Jun 14, 2022): Other then during migration times, it makes sense to share.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6991