how to clear browser cache code example

Example 1: chrome clear cache for one site

chrome://settings/siteData

Example 2: what is a browser cache

When you visit a website, your browser takes pieces of
the page and stores them on your computer's hard drive.
Some of the assets your browser will store are:

Images - logos, pictures, backgrounds, etc.
HTML
CSS
JavaScript
In short, browsers typically cache what are known as 
"static assets" - parts of a website that do not change
from visit to visit.

Example 3: chrome refresh cache

CTRL+F5 : to refresh the page by clearing GG chrome cache.

Example 4: 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;

Example 5: empty cache

a hard reload option
clears the browser cache before the hard reload is activated.
hard reloads usually only bypasses the cache. 
but because web pages may download additional content 
using JavaScript not part of the initial page load
that may be cached and loaded from cache 
even if you do a hard reload.

Tags:

Php Example