-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Prefer PhpFileCache for caching docs #7500
Conversation
Please amend your commit message: - Remvoes APCu because it is not as performant as PhpFileCache and cannot
- be cleared using using console tools.
+ Removes APCu because it is not as performant as PhpFileCache and cannot
+ be cleared using console tools. Also, what do you mean by "docs"?
EDIT: at first, I thought you mean "for caching phpdoc", meaning annotations, now I get it. |
@greg0ire updated. |
Please amend your commit message: - be cleared using using console tools.
+ be cleared using console tools. |
Removes APC and XCache because they are deprecated. Removes APCu because it is not as performant as PhpFileCache and cannot be cleared using console tools.
@greg0ire fixed. |
Just like APCu, OPCache can't be cleared from CLI either. So in the end this isn't any improvement. |
@Majkl578 clearing PhpFileCache means Edited, see #7500 (comment) |
Only if configured to do so, and this setting should be disabled on production. |
There 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.
As per my comment above, one can of worms is being replaced by another can of worms while the original issue remains.
I support getting rid of APCu, but this is not the correct way.
The PhpFileCache is perfectly fine for any static-ish setups, like
metadata: even better, it fits most deployment strategies too.
…On Wed, 5 Dec 2018, 13:26 Michael Moravec ***@***.*** wrote:
***@***.**** requested changes on this pull request.
As per my comment above, one can of worms is being replaced by another can
of worms while the original issue remains.
I support getting rid of APCu, but this is not the correct way.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7500 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakEh6SlFw40IBdEyiqR928VgIXPOZks5u17uEgaJpZM4Y9PlG>
.
|
It's quite important to remember that our cache providers don't remove anything on What @Majkl578 said is really important, the recommended opcache production setup ® doesn't track file system updates (which is what makes opcaching truly remarkable), therefore you can refresh stuff and the app won't get updated unless the deployment is done in a separated environment (phoenix servers, containers, etc) - or reseting opcache (which is possibly done when reloading the web service workers). |
@shadowhand let's remove opcache from equation for one sec. When we do the For production, opcache usually is configured like this (apart from other ones):
The comments of the first one give us the answer to your question:
So, no, namespace version change won't be propagated unless opcache is cleared manually or via webserver restart. |
@shadowhand sorry about the huge delay here... I'd say that it's fine to use file system cache for annotations, query, and metadata cache but for result set and L2C I'd rather suggest Redis. |
There 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.
I would also not remove APCu and XCache from the docs because they're also helpful scenarios where it's just fine to use them (containerised apps or blue-green deployments).
<?php | ||
$cacheDriver = new \Doctrine\Common\Cache\ApcCache(); | ||
$cacheDriver->save('cache_id', 'my_data'); | ||
PhpFileCache |
There 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.
I think the best way for this is to have another header grouping distributed (redis, memcached, etc) and non-distributed (filesystem, apcu, etc) providers. Stating that non-distributed ones are completely fine for query and metadata caches whereas distributed ones are better suited for result set and second-level caches.
APCu | ||
~~~~ | ||
The preferred cache driver is ``PhpFileCache``. This driver serializes | ||
cache items and writes them to a file. This allows for opcode caching |
There 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.
It would be really nice if we mention the impact of opcache configuration and what are the architectural consequences of them. Or maybe point to an external resource with that info.
There 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.
Because an external resource might disappear, that short mention of the impact would be nice as an extra.
@shadowhand thanks a lot for the initial write-up. I hope my suggestions make sense to you and help us move this further. We're working to finalise the Thanks again for your contribution 👍 |
@@ -304,8 +270,11 @@ use on your ORM configuration. | |||
.. code-block:: php | |||
|
|||
<?php | |||
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCacheCache( |
There 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.
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCacheCache( | |
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCache( |
@@ -318,7 +287,11 @@ cache implementation. | |||
.. code-block:: php | |||
|
|||
<?php | |||
$config->setResultCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); | |||
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCacheCache( |
There 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.
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCacheCache( | |
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCache( |
@@ -335,7 +308,11 @@ result cache driver. | |||
.. code-block:: php | |||
|
|||
<?php | |||
$query->setResultCacheDriver(new \Doctrine\Common\Cache\ApcuCache()); | |||
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCacheCache( |
There 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.
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCacheCache( | |
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCache( |
@@ -387,7 +364,11 @@ first. | |||
.. code-block:: php | |||
|
|||
<?php | |||
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); | |||
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCacheCache( |
There 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.
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCacheCache( | |
$cacheDriver = new \Doctrine\Common\Cache\PhpFileCache( |
APCu | ||
~~~~ | ||
The preferred cache driver is ``PhpFileCache``. This driver serializes | ||
cache items and writes them to a file. This allows for opcode caching |
There 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.
Because an external resource might disappear, that short mention of the impact would be nice as an extra.
Merged in 20c4603 |
Removes APC and XCache because they are deprecated.
Remvoes APCu because it is not as performant as PhpFileCache and cannot
be cleared using using console tools.
Refs #7493 (review)