How can I invalidate the page in the browser cache from the client side?

Do I need a client (using javascript) to invalidate the page it has and essentially retrieve the new version?

I thought I could do all this with headers: Invalid cached content, If-Modified Headers?

If there is no way to update the browser in the current cached version without creating a new request (via a new URL) ... so that the same original URL request can be used to view the updated content?

+3
source share
4 answers
+5

, :

location.reload(true);

""

'...?rnd=' + Math.random();
+7

, . :

document.location.href = 'mypage.html?randomVar=454068934';

. javascript .

+3

, URL. .. products.php, products.php? rand = 23443545. , .

+1
source

Source: https://habr.com/ru/post/1715561/


All Articles