I am wondering whether is possible to detect if requested page has been cached before or not.
Idea: When you visit malicious webpage, the site redirect you (using ajax) to www.stackoverflow.com for example and check if it is cached or not, with a big list of sites attacker can steal your web-browser history.
Realisation: My current idea is start timer, launch get request on a page, wait page to load, then stop the timer, using difference between dates. Then launch the request again, this time with cache: false flag and then compare both times to determine whether page was cached or not.
Question: Is this possible scenario and more important how to prevent this kind of attack.
Thank you for your answers!