nginx cached index.html force reload nginx cached index.html force reload nginx nginx

nginx cached index.html force reload


There is no way manually reset browser cache on user side (browser) while the client do not request to server for new content. In this case can be useful access to any scripts, that you SPA is download without cache. In this case you can change this script and run force reload page (but be careful - you need any flag for prevent permanent force reloading after every page loading). For example, if you have GTM on site - this can help.

UPD:I am not js specialist, but you needed to add GTM tag on all pages like this js-script:

function getCookie(name) {  let matches = document.cookie.match(new RegExp(    "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"  ));  return matches ? decodeURIComponent(matches[1]) : undefined;}was_reloaded = getCookie('was_reloaded')alert(was_reloaded)if (was_reloaded != 'yes') {        document.cookie = "was_reloaded=yes; path=/; max-age=3600;"    location.reload();} }