Geen caching script

Het volgende script zet /?willekeurigetekens achter de link zodat de browser het inlaadt zonder LOKALE cache.

Hou bij gebruik van dit script er rekening mee dat bugherd niet werkt.

PHP:

				
					
				
			

JS:

				
					function NoCache() {
  if (window.location.href.indexOf("wp-admin") === -1) {
    if( window.localStorage ){
      if(!localStorage.getItem('firstReLoad')){
        localStorage['firstReLoad'] = true;
        window.location.href = (window.location.href.split('?')[0]) + '?' + Math.floor(Math.random() * 1000);
      } else {
        localStorage.removeItem('firstReLoad');
      }
    }
  }
}

if (!(window.location !== window.parent.location)) {
      NoCache();
}
				
			

CSS