PHP Question

What is warming up a cleared cache?

Can someone please explain in newbie words what is the meaning of

warming up
a cache after clearing it?

In Symfony2, there is a command that allows clearing the cache:

php app/console cache:clear

But sometimes while installing some bundles, the installation tries to clear the cache and when failed, it throws a warning saying:

Cannot clear cache with

Why to clear the cache during bundle installation? And why to warmup? Your usual explanations are greatly precious.

Answer Source

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.


Real world example: you give some stats that need to be cached so you can write your own service that will be called onto kernel.cache_warmer event to perform this task "statically".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download