Completed the caching scripts