- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Disable browser caching with meta HTML tags
To disable browser caching with <meta> tag in HTML, use the following code −
<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" />
HTML lets you specify metadata - additional important information about a document in a variety of ways. The META elements can be used to include name/value pairs describing properties of the HTML document, such as author, expiry date, a list of keywords, document author etc.
The <meta> tag is used to provide such additional information. This tag is an empty element and so does not have a closing tag but it carries information within its attributes.
Example
Let us see a simple example. We have entered the meta http equiv to disable browser caching −
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <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" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Center Div Elements</title> </head> <style> .mydiv{ color: red; background: yellow; } </style> <body> <h1>Demo Heading</h1> <div class='mydiv'> This is demo text. </div> </body> </html>
Output

- Related Articles
- How to replace default meta tag from “layout” with customizing meta tags in “view” with HTML?
- What are the different tags to define special meta information in HTML page?
- HTML DOM Meta Object
- Ember.js browser support with HTML
- How to disable browser's back button with JavaScript?
- HTML Deprecated Tags
- Remove and add new HTML Tags with JavaScript?
- How to remove HTML Tags with RegExp in JavaScript?
- Include meta data in an HTML document
- HTML Viewport meta tag for Responsive Web Design
- How to programmatically empty browser cache with HTML?
- Meta programming with Metaclasses in Python
- How to use Meta Tag to redirect an HTML page?
- innerHTML adds text but not HTML tags
- What is caching?

Advertisements