Prototype of cached reading from file