A fejlécek megfelelő minimális halmaza, amely a legfontosabb böngészőkben működik:
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Ahol:
Cache-Control
a HTTP 1.1-re vonatkozikPragma
a HTTP 1.0-ra vonatkozikExpires
az a proxy
Web Pages (HTML)
A weblapokhoz (HTML) adja hozzá a következő <meta>
címkéket ahhoz az oldal (ok) hoz, amely (ek) hez a böngészőket nem kívánja gyorsítótárazni (a kódnak <head>
az oldal szakaszában kell lennie , például közvetlenül a <title>
címke után ):
<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" />
.htaccess (Apache)
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
Java Servlet
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);
PHP
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');
ASP
Response.addHeader "Cache-Control", "no-cache, no-store, must-revalidate"
Response.addHeader "Pragma", "no-cache"
Response.addHeader "Expires", "0"
ASP.NET
Response.AppendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
Response.AppendHeader("Pragma", "no-cache");
Response.AppendHeader("Expires", "0");
Ruby on Rails
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
response.headers['Pragma'] = 'no-cache'
response.headers['Expires'] = '0'
Python on Flask
resp.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
resp.headers["Pragma"] = "no-cache"
resp.headers["Expires"] = "0"
Google Go
responseWriter.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
responseWriter.Header().Set("Pragma", "no-cache")
responseWriter.Header().Set("Expires", "0")