How to prevent web page caching across all browsers

HTTP Headers bbc.co.uk

There are two main types of cache headers, Cache-Control  and Expires . They define the caching characteristics of your resources. Typically, Cache-Control  is a better approach than Expires , however, both headers can be used simultaneously.

Cache headers are applied to resources at the server level, for example, in the .htaccess of an Apache server.

If you don’t want pages to be cached by the web browser, the minimum set of headers that work for most browsers and proxies are:

Cache-Control is for browsers and proxies using the HTTP/1.1 protocol.

Pragma  is for old browsers using the HTTP/1.0 protocol

Expires is for browsers and proxies, although in HTTP/1.1  Cache-Control takes precedence over  Expires .

You can set the response headers for a page served over a HTTP connection.

Classic ASP

Node.js

PHP

.htaccess

IIS web.config

About the Author: George

Close Bitnami banner
Bitnami