initial caching code
serve file from the cache if available