Skip to content

Commit

Permalink
bug #3689 Fix cache warmer description (WouterJ)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Fix cache warmer description

| Q   | A
| --- | ---
| Doc fix? | yes
| New docs? | no
| Applies to | all
| Fixed tickets | -

- The warmers are also executed on the first request: https://github.com/symfony/HttpKernel/blob/master/Kernel.php#L568-571
- Defining optional warmers has some effects, saying it has no effect is wrong.

Commits
-------

ac0f66d Updated the description of cache warmers
  • Loading branch information
weaverryan committed Mar 18, 2014
2 parents 6221f35 + ac0f66d commit 9dd8d96
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ kernel.cache_warmer
**Purpose**: Register your service to be called during the cache warming process
Cache warming occurs whenever you run the ``cache:warmup`` or ``cache:clear``
task (unless you pass ``--no-warmup`` to ``cache:clear``). The purpose is
task (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. 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 All @@ -423,7 +424,7 @@ the :class:`Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerInterface` i
{
public function warmUp($cacheDir)
{
// do some sort of operations to "warm" your cache
// ... do some sort of operations to "warm" your cache
}
public function isOptional()
Expand All @@ -433,8 +434,9 @@ the :class:`Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerInterface` i
}
The ``isOptional`` method should return true if it's possible to use the
application without calling this cache warmer. In Symfony 2.0, optional warmers
are always executed anyways, so this function has no real effect.
application without calling this cache warmer. In Symfony, optional warmers
are always executed by default (you can change this by using the
``--no-optional-warmers`` option when executing the command).
To register your warmer with Symfony, give it the ``kernel.cache_warmer`` tag:
Expand Down

0 comments on commit 9dd8d96

Please sign in to comment.