Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

cache:clear clears all kind of cache (even the application one) #23685

Copy link
Copy link
Closed
@tristanbes

Description

@tristanbes
Issue body actions
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 from post-script in composer.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 :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.