when is the case to use ccache?

ccache

Solution

Aside from the dubious benefit of speeding up clean builds necessitated by a broken buildsystem, and the mere accidental benefit of having a shared cache, there exists a legitimate use of ccache even for an isolated flawless mtime based buildsystem:

When you are jumping back and forth between branches (not talking about separate directories), or rebasing, such that you end up touching a whole bunch of files, or if you're unlucky, a central header (like config.h) that's included all over the place, your flawless mtime based buildsystem would dutifully rebuild everything. If you have built mostly the same state some time in the past, ccache will speed up this rebuilding.

Problem

As far as I know, ccache speed up compilation by catching previous compilations and detecting when the same compilation is being done again. however, makefile do the same thing. so why should we need ccache? when is the case we use it? thanks!

Original source