Create cache.c

handle caching