Create the cache directories if they don't already exist.