HTML Meta Tag Usage

HTML Meta Tag Usage

True to its name, a meta tag is a self-referential element added to web pages for storing information about itself. It might seem a bit odd to add such a thing, but meta tags actually have functionality beyond setting a page description or upping the keyword count for search engine optimization.

Most of the uses for HTML meta tags will cover every major web browser, but there are a few significant values or specifications that are browser-specific. It's worth taking a deeper look if you require more control for a niche of your website visitors.

Controlling Cache and Setting Cookies

For any website with large, repeated visual elements like photographs, one might wish to utilize web browser cache to increase loading speeds for subsequent visits by the user. Be careful! Improper cache control may, in some cases, result in a user not being able to view any updates or changes recently made to the page. The specification "no-store" will disable the browser cache, but you'll need to make the decision to include this meta tag on a case-by-case basis.

A widely used, if somewhat controversial, function of HTML tags, "Set-Cookie", is the ability to place and even reuse cookies stored in the web browser. As a result of poor practices in the past with cookies that stored data about personal web traffic and other user data, you've likely seen multiple disclaimers on popular websites about the placement of cookies in your browser.

If your web design requires cookies for functionality, you'll want to pay extra attention to the "name", "path", and "expires" values. Some users are completely unaware of the very existence of cookies, but any of your visitors that do will be immediately put off by misleading cookie names or expiration dates lasting for decades. The last thing you want to do is immediately alienate tech-savvy users before they've even explored your site.

Refreshing and Redirecting

At first glance, using "refresh" is straightforward and self-explanatory. The specification is set in seconds and will mostly be utilized for consistently updating a page with live data or newsfeeds. Special care and consideration is needed when using the specification on any page on which a user must enter information into any fields, as the refresh can be annoying for slower typers or apprehensive users.

A unique use of "refresh" comes with the added value of an URL included with the refresh time. The browser will redirect to the desired URL after the time, and can even redirect immediately when the "refresh" value is set to zero.