Added option to use cache or not