<meta> is a piece of information on a web page. Meta tags are not displayed but are used to provide information to browsers and search engines. Meta elements are usually used to define page descriptions, keywords, document authors, updates, and other metadata.
However, you need to know that there are a number of meta tags that have more than just a description or information keyword. In this article, I will show you 5 meta tag features that some of you may not know about.
1. Controlling Browser Cache
When you visit a web page, the browser automatically caches the web page to make it load faster on subsequent visits. You may have come across an instance where your page was not updated with the changes you made. This happens because the browser is still storing old cached pages. To prevent that from happening, you can disable browser cache by using a meta tag. So that every visitor will see the changes made from your site. To disable browser cache, you can use:
<meta http-equiv="Cache-Control" content="no-store" />
This meta tag is valid in Firefox, Chrome, and Internet Explorer.
You can also set an expiration date to ensure that the browser will show files that are fresh from the server, rather than from the cache.
<meta http-equiv="expires" content="Fri, 18 Jul 2014 1:00:00 GMT" />
The meta data above means that the document is considered to expire after a certain date and time. If you set it to “0”, the browser will check for new updated documents on each visit.
2. Cookies Settings
<meta http-equiv="Set-Cookie" content="name=data; path=path; expires=Day, DD-MMM-YY HH:MM:SS ZONE">
To set cookies on meta-tags you can use:
name = Data is the name of the cookie that defines the value set in it. path is the document path. Meanwhile, the expiration value shows the time and date when the cookie was deleted from your computer. If you leave the expiration date blank, the cookies will be deleted after you exit the browser.
3. Refreshing Web Pages
You can set your site to refresh automatically within a certain period of time with meta http-equiv = “refresh” . The meta-tag below will make the browser refresh the page every 10 seconds.
<meta http-equiv="refresh" content="5">
We can also use the meta refresh tag to redirect the page to a specific destination. In this example, after 5 seconds the page will automatically redirect to example.com
<meta http-equiv="refresh" content="5; url=http://example.com/">
To redirect pages directly, set to 0.
5. Page Transitions
You can also apply transitions to your web pages with meta-tags in a similar way to PowerPoint. The syntax of the transition page with the meta tag looks like this:
<meta http-equiv="page-enter" content="revealtrans(duration=seconds,transition=num)" />
<meta http-equiv="page-exit" content="revealtrans(duration=seconds,transition=num)" />
Note: that this only works on legacy Internet Explorer, since page-enter and page-exit are Microsoft’s proprietary meta tag specifications. You can define how long the transition will last for using the duration. Transitions must be an integer between 0-23 which refers to the transition type provided by Microsoft.