ccache is a compiler cache. It speeds up re-compilation of C/C++ code by caching previous compiles and detecting when the same compile is being done again.
The following is a step by step guide to how to enable and use ccache on FreeBSD 7.1:
- su
- # cd /usr/ports/devel/ccache
- # make install clean
- # vim /etc/make.conf
.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) && !defined(NOCCACHE)
CC=/usr/local/libexec/ccache/world-cc
CXX=/usr/local/libexec/ccache/world-c++
.endif
Basically we’ve started by installing ccache (steps 1 through 3) and proceeded by editing /etc/make.conf as to enable ccache on builds.
Now we need to update the environment.
Further instructions here
Source: linux-bsd-sharing.blogspot.com (19/01/2009)

Is ccache very beneficial if you are only really compiling things like ports, where (hopefully) you are only compiling the once? Or does it cache different routines which could be useful with many ports installs?