How do I prevent caching of web pages by browsers?

How do I prevent caching of web pages by browsers? cover image
  1. Home
  2. Web Development
  3. How do I prevent caching of web pages by browsers?

The web pages you view are stored by your system inside the cache directory. Now, when you view these pages again, the browser searches the cache, and if it finds the page there, it displays it immediately. This presents problems to web developers when they update a page since the visitors see an older version (that was stored in the cache) of the page.

To prevent this from happening set the expiration date in the past inside the <meta>. Thus the browser reloads the page every time the user visits.

Here is the code:

<meta http-equiv="expires" value="Thu, 16 Mar 2000 
11:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
Web Development