Moves caching to head.cpp