Has cache implementation taken from tutorial.  Haven't tested the code.