I implemented a cache on top of computing the IDF and on top of the weights returned from the WeightFeature factory.