Description
Q | A |
---|---|
Bug report? | yes/no (not sure) |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | >3.1 |
Hello,
After some weird problem in production, we just realized that using that running bin/console cache:clear
removes all kind of cache, even custom one defined by developper like using the RedisAdapter
.
In my team we are splitted between "it's normal" and confusion. This command has been around since Symfony 2.0
and I would have never excepted to have an undocumented impact on a cache component introduced in Symfony 3.1
My point is :
Symfony has his internal cache (metadata cache + var/cache
) which is totally fine to clear when running cache:clear
command
Symfony provides cache component in order to use it for our app needs, so why, when we need to clear internal Symfony cache (var/cache
) this command also earase all keys for our application cache ?
I think it's a dangerous behaviour because:
- By default, in standard edition
cache:clear
is called frompost-script
incomposer.json
. So each time we deploy and run composer install. It'll remove all cache, even if you don't want to. - This feature (or bug :p) is not documented
We deliver 5-20 times per day, so we resolved this issue by no longer cache:clear
the application removing it from the composer script section
(that will lead all developpers to weird behaviour after adding some libraries, because it won't be done automatically).
Maybe I don't have the correct argument but can you please provide your point of view to what led you to this decision, and how to keep our application cache while still have the possibility to delete internal symfony cache ? (please don't tell me that we have to use another cache bundle to be able to achieve that.... it would be so much waste)
imho, we should have a way to clear all internal symfony cache in a separate way from the cache we use for our application.
Thank you :-)