optimise cachefile logic - still not sure why the cachefile profiling was getting triggered on a site with no cachefile configured