fixed prototype
added CacheInvalidator, moved caching stuff to its own namespace