Use cache entry size in `checkJSONSize`.

See #233.
See #228.
Rename `checkCacheSize`.

See #233.
Closes #228.