Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Serializer] RewriteAbstractObjectNormalizer::createChildContext()
to use the providedcache_key
from original context when creating child contexts#53530
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Follow-up of#53523 |
src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
AbstractObjectNormalizer::createChildContext()
to use the provided cache_key from original context when creating child contextsAbstractObjectNormalizer::createChildContext()
to use the providedcache_key
from original context when creating child contextsThere 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 with minor CS comments
src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
… to use the provided `cache_key` from original context when creating child contexts
Thank you@amne. |
…false (xabbuh)This PR was merged into the 5.4 branch.Discussion----------[Serializer] do not overwrite the cache key when it is false| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Issues |Fix#53530 (comment)| License | MITCommits-------fd00244 do not overwrite the cache key when it is false
If the normalization starts with an initial 'cache_key' it is currently discarded when creating child contexts. This change fixes that.
The main reason behind it is that if the client code sends a unique identifier (ApiPlatform injects the IRI) and we have a use case
that iterates a big resultset we end up with a big private cache that quickly runs out of allowed memory. The solution should be to
send a 'cache_key' which skips the entire cache key calculation that hashes the context.