Clear cache method. code example
Example: how to clear cache
ChromeDriver chromeDriver = new ChromeDriver();
chromeDriver.manage().deleteAllCookies();
chromeDriver.get("chrome://settings/clearBrowserData");
chromeDriver.findElementByXPath("//settings-ui").sendKeys(Keys.ENTER);
return chromeDriver;