Skip to main content

Stop Browser Caching using Meta Tags

Browsers typically cache the page it has visited to save on bandwidth and load time. This means that when you hit the back button, the browser will use its locally stored page instead of requesting the page again from the server.



You may not want browsers to cache pages in several instances such as for online forms where credit card or personal details are viewable. Another instance is when you’re trying to password protect web pages when using scripts such as Simple Authorization Script.
To stop browsers from storing a version of your web page in its cache, use the meta tag, Pragma:No-Cache, that is,

<meta http-equiv="PRAGMA" content="NO-CACHE">
This meta tag needs to be included between the head tags of your html page.
<html>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE">
</head>
<body>


Unfortunately, the Pragma:No-Cache meta tag is not 100% bug free. Work arounds are needed for Internet Explorer and Internet Explorer 5 as its caching mechanism is a little “special” and extra code is required.

Work Around for Internet Explorer

For Internet Explorer, you would need to add another set of head tags that contains the Pragma:No-
Cache meta tag between </body> and </html>. This means you would have 2 sets of head tags, one at the top of the page and one at the bottom of the page.

<html>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE">
</head>
<body>

AND
</body>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE">
</head>
</html>


Work Around for Internet Explorer 5

For Internet Explorer 5, you would need to add an additional Expire:-1 meta tag, that is, <meta http-equiv=”EXPIRES” content=”-1″> along with the Pragma:No-Cache meta tag. Both meta tags need to be included at the top and bottom of the page as with the work around for Internet Explorer.
<html>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE">
<meta http-equiv="EXPIRES" content="-1">
</head>
<body>

AND
</body>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE">
<meta http-equiv="EXPIRES" content="-1">
</head>


Popular Posts

Top Website Builders 2020 for Beginners: Guide for Choosing the Best Website Builder that Fits for You

Planning to build a professional website but had no idea where to start? You are in the right place. See the leading Website Builders in the industry and choose the one that’s best for your needs. Below are the top 10 Website Builders in our list: Wordpress Wix Squarespace Weebly Ucraft Jimdo Site123 Strikingly GoDaddy Network Solutions Our top 3 are Wordpress , Wix and Squarespace . 1. Wordpress WordPress gives you everything you need to create anything you want online. It’s flexible, secure, and powerful, just like you want your business to be. Dozens of themes Mobile-friendly Fast, friendly support In-depth stats Search engine optimized Try Wordpress 2. Wix Wix is a powerful technology that makes it easy for everyone to get online with a stunning, professional and functional web presence. Whether it’s your first time creating or you’re a long-time expert, you’ll find the features and solutions you need to build a professional websit...

6 Best JavaScript Frameworks to Use in 2020 for Developers

JavaScript is a scripting language used to create and control dynamic website content. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. JavaScript enables interactive web pages and is an essential part of web applications. Here is the top 10 list of the best Javascript Frameworks: React Angular Vue Ember Node Backbone 1. React React is a javascript library created by Facebook. It is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called “components”. Learn more about React 2. Angular AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and depe...

The Best eCommerce Website Builders 2020 for Small Business

If you want to build an online store from scratch, then there are a few excellent choices for you to consider. Using a website builder will let you create a stunning, brilliant and a professional look and feel online store. It will also work as a platform to manage your inventory and sales. Below are the 10 best eCommerce website builders: Shopify Wix Stores Squarespace Weebly Square BigCommerce 3DCart Volution Big Cartel GoDaddy Our top 3 are Shopify , Wix Stores , and Squarespace . 1. Shopify Shopify is is a commerce platform that allows anyone to set up an online store and sell their products. Merchants can also sell their products in person with Shopify POS. From drop shipping to social media marketing, the Shopify App Store has over 3,200 apps to help you start, manage, and grow your business. 70+ professional themes Mobile commerce ready Free SSL certificate Accept credit cards with Shopify Dropshipping Try Shopify 2. Wix Stores Wix Sto...