Skip to content

Deprecated cache:clear with warmup #7846

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

Merged
merged 1 commit into from
Apr 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ You also need to change the ``extra.symfony-web-dir`` option in the

.. code-block:: terminal

$ php bin/console cache:clear --env=prod
$ php bin/console cache:clear --no-warmup --env=prod
$ php bin/console assetic:dump --env=prod --no-debug

Override the ``vendor`` Directory
Expand Down
21 changes: 9 additions & 12 deletions console/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ The :doc:`/components/console/usage` page of the components documentation looks
at the global console options. When you use the console as part of the full-stack
framework, some additional global options are available as well.

By default, console commands run in the ``dev`` environment and you may want
to change this for some commands. For example, you may want to run some commands
in the ``prod`` environment for performance reasons. Also, the result of some commands
will be different depending on the environment. For example, the ``cache:clear``
command will clear and warm the cache for the specified environment only. To
clear and warm the ``prod`` cache you need to run:
By default, console commands run in the ``dev`` environment and you may want to
change this for some commands. For example, you may want to run some commands in
the ``prod`` environment for performance reasons. Also, the result of some
commands will be different depending on the environment. For example, the
``cache:clear`` command will clear the cache for the specified environment only.
To clear the ``prod`` cache you need to run:

.. code-block:: terminal

$ php bin/console cache:clear --env=prod
$ php bin/console cache:clear --no-warmup --env=prod

or the equivalent:

.. code-block:: terminal

$ php bin/console cache:clear -e prod
# this is equivalent:
$ php bin/console cache:clear --no-warmup -e prod

In addition to changing the environment, you can also choose to disable debug mode.
This can be useful where you want to run commands in the ``dev`` environment
Expand Down
5 changes: 3 additions & 2 deletions deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ as you normally do:
D) Clear your Symfony Cache
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Make sure you clear (and warm-up) your Symfony cache:
Make sure you clear and warm-up your Symfony cache:

.. code-block:: terminal

$ php bin/console cache:clear --env=prod --no-debug
$ php bin/console cache:clear --env=prod --no-debug --no-warmup
$ php bin/console cache:warmup --env=prod

E) Dump your Assetic Assets
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
6 changes: 6 additions & 0 deletions reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,12 @@ process
Cache warming occurs whenever you run the ``cache:warmup`` or ``cache:clear``
command (unless you pass ``--no-warmup`` to ``cache:clear``). It is also run
when handling the request, if it wasn't done by one of the commands yet.

.. versionadded:: 3.3
Starting from Symfony 3.3, the warm-up part of the ``cache:clear`` command
is deprecated. You must always pass the ``--no-warmup`` option to
``cache:clear`` and use ``cache:warmup`` instead to warm-up the cache.

The purpose is to initialize any cache that will be needed by the application
and prevent the first user from any significant "cache hit" where the cache
is generated dynamically.
Expand Down