Suggestion: Cache generation/warming for static caches. #8639
-
Assuming metadata/annotations/queries are static in production I would like a way to warm the cache during deployment. Specifically I would like to be able to generate files for these items when using a file cache during my deployment process. If this seems possible but unlikely to be tackled, I would appreciate any guidance on where to start if I wanted to build a solution as a longer term side project. Also, if anyone could enlighten me on how doctrine file caches interact with opcache.validate_timestamps=0 that would be helpful. Thanks in advance. Edit: It occurred to me that the metadata cache may be created during proxy generation, will verify. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, this is something you can automate. Symfony for example does this in their Doctrine integration. The way to go would be something like this: $metadatas = $entityManager->getMetadataFactory()->getAllMetadata(); // this will create cache entries for all metadata
$entityManager->getProxyFactory()->generateProxyClasses(
$metadata,
$entityManager->getConfiguration()->getProxyDir()
); |
Beta Was this translation helpful? Give feedback.
Yes, this is something you can automate. Symfony for example does this in their Doctrine integration.
The way to go would be something like this: