Moved index caching code to indexer