bug: Fix the size not being reset to 0 when the cache clears itself

When the cacheFlushInterval is set the cache wasn't reseting its size when it cleared itself.

fixes #14