Cache read-only complete

May not compile, haven't tested the latest modifications