renamed cache method to applyCache