HTML JS

HOW TO FORCE BROWSERS TO RELOAD CSS JS

(quick guide & examples)

Press and hold CONTROL (COMMAND in Mac), then click on the reload button.

Shortcut key - CONTROL-F5 or CONTROL-SHIFT-R

Keys will differ from browser to browser. Check with your browser's help document.

FORCE BROWSER RELOAD

01

F12 to open developer's console. Application > Storage > Clear site data.

SIMPLY CHANGE FILE NAME <!-- <script src="FOO.JS"> -->  <script src="FOO-V2.JS">

OUTPUT CACHE-CONTROL HEADER. PHP EXAMPLE: header("Cache-Control: no-cache, must-revalidate");

APPEND DUMMY TIMESTAMP  <script src="FOO.JS?t=123">

PROGRAMMATIC RELOAD (A)

02

APACHE EXPIRES HEADER <IfModule mod_expires.c>      ExpiresActive on      ExpiresByType text/css "access"   ExpiresByType text/js "access"   ExpiresByType text/javascript "access" </IfModule>

PROGRAMMATIC RELOAD (B)

03