Initialize cache variables at startup.