Added size management for cached resources (especially for in-memory
cache).