Cache only when is necessary