Add max cache size

Add max cache size (defaults to 100).

Remove oldest cache entry when full.