freddyb's code to read cache