Disable browser cache

You must send the HTTP header in the minimal set of instructions to disable the browser cache. The most important are:

Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

Where in particular the three instructions indicate:

  1. HTTP 1.1 Cache-Control:
  2. Pragma: for HTTP 1.0
  3. Exprires: for proxies

These instructions can be given in several ways.

Browser cache control

Web pages (HTML)

Must be entered in the<HEAD>just after the opening<TITLE>:</TITLE></HEAD>

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

Apache haccess.

<IfModule mod_headers.c=""></IfModule>
 Header set Cache-Control "no-store, no-cache, must-revalidate"
 Header set Pragma no-cache directive
 Header set Expires 0


header (' Cache-Control: no-Cache, no-store, must-revalidate ');
header (' Pragma: no-cache ');
header (' Expires: 0 ');

RFC references


Leave a Reply

Your email address will not be published. Required fields are marked *

For Inspirations, Special Offers and Much More


Via Scoglio grosso 28
05100 Terni, Italy
+39 3388383150

cf: VNTFNC73P11L117N
p.iva: 00723880555

©Francesco Venturini. All Rights Reserved