8000 minor #7846 Deprecated cache:clear with warmup (javiereguiluz) · symfony/symfony-docs@4780ba4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4780ba4

Browse files
committed
minor #7846 Deprecated cache:clear with warmup (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Deprecated cache:clear with warmup This fixes #7696. Commits ------- 6b3a427 Deprecated cache:clear with warmup
2 parents 1dd8b5d + 6b3a427 commit 4780ba4

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

configuration/override_dir_structure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ You also need to change the ``extra.symfony-web-dir`` option in the
168168

169169
.. code-block:: terminal
170170
171-
$ php bin/console cache:clear --env=prod
171+
$ php bin/console cache:clear --no-warmup --env=prod
172172
$ php bin/console assetic:dump --env=prod --no-debug
173173
174174
Override the ``vendor`` Directory

console/usage.rst

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,19 @@ The :doc:`/components/console/usage` page of the components documentation looks
88
at the global console options. When you use the console as part of the full-stack
99
framework, some additional global options are available as well.
1010

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

1818
.. code-block:: terminal
1919
20-
$ php bin/console cache:clear --env=prod
20+
$ php bin/console cache:clear --no-warmup --env=prod
2121
22-
or the equivalent:
23-
24-
.. code-block:: terminal
25-
26-
$ php bin/console cache:clear -e prod
22+
# this is equivalent:
23+
$ php bin/console cache:clear --no-warmup -e prod
2724
2825
In addition to changing the environment, you can also choose to disable debug mode.
2926
This can be useful where you want to run commands in the ``dev`` environment

deployment.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,12 @@ as you normally do:
153153
D) Clear your Symfony Cache
154154
~~~~~~~~~~~~~~~~~~~~~~~~~~~
155155

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

158158
.. code-block:: terminal
159159
160-
$ php bin/console cache:clear --env=prod --no-debug
160+
$ php bin/console cache:clear --env=prod --no-debug --no-warmup
161+
$ php bin/console cache:warmup --env=prod
161162
162163
E) Dump your Assetic Assets
163164
~~~~~~~~~~~~~~~~~~~~~~~~~~~

reference/dic_tags.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,12 @@ process
504504
Cache warming occurs whenever you run the ``cache:warmup`` or ``cache:clear``
505505
command (unless you pass ``--no-warmup`` to ``cache:clear``). It is also run
506506
when handling the request, if it wasn't done by one of the commands yet.
507+
508+
.. versionadded:: 3.3
509+
Starting from Symfony 3.3, the warm-up part of the ``cache:clear`` command
510+
is deprecated. You must always pass the ``--no-warmup`` option to
511+
``cache:clear`` and use ``cache:warmup`` instead to warm-up the cache.
512+
507513
The purpose is to initialize any cache that will be needed by the application
508514
and prevent the first user from any significant "cache hit" where the cache
509515
is generated dynamically.

0 commit comments

Comments
 (0)
0