Use off_t instead of size_t for read size (to avoid integer overflow).
Also, fix "unused variable" warning in cache.cpp.