Skip to content
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

api_platform.metadata.property.identifier_metadata_factory is not cached #5285

Closed
MariusJam opened this issue Dec 21, 2022 · 2 comments
Closed
Labels

Comments

@MariusJam
Copy link
Contributor

API Platform version(s) affected: 3.0.8

Description

As stated in #4975 (this comment), the service api_platform.metadata.property.identifier_metadata_factory (which is suggested to be removed in 3.0 by a TODO comment) has no cache associated with it.

This leads to cache warmup being longer as the service is call again and again.

After a bit of investigation, I'm wondering whether this wasn't the orginal purpose of api_platform.cache.identifiers_extractor which is sent as argument to api_platform.cache_warmer.cache_pool_clearer in events.xml but which seems to be actually inexistent.

How to reproduce

bin/console cache:warmup

Possible Solution

Configure a cache for api_platform.metadata.property.identifier_metadata_factory, possibly by restoring api_platform.cache.identifiers_extractor

@soyuka
Copy link
Member

soyuka commented Dec 26, 2022

Probably because https://github.com/api-platform/core/blob/2.6/src/Api/CachedIdentifiersExtractor.php was removed in 3.x..

The series of metadata.property.identifier_metadata_factory is there to avoid a circular dependency injection within PropertyMetadataFactories. We could probably add a cache layer for them by duplicating this declaration:

https://github.com/api-platform/core/blob/main/src/Symfony/Bundle/Resources/config/metadata/property.xml#L26

PR welcome.

@stale
Copy link

stale bot commented Feb 24, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 24, 2023
@stale stale bot closed this as completed Mar 3, 2023
@soyuka soyuka added bug and removed stale labels Mar 4, 2023
@soyuka soyuka reopened this Mar 4, 2023
@soyuka soyuka closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants