VIRTUAL-WORLD.COM

PC Magazine

  PC Tech

Meta Tags Target Your Pages

Introduction

Metadata: History and Syntax

Beat the Search Engines

Manage Content

Resources



X10.com - The SuperSite for Home Automation!

FREE investing information on 400 top companies - click here!

 
  Categories
World Wide Web

Meta Tags Target Your Pages
Manage Content

Continued from Beat the Search Engines

Meta tags can also help you manage content--and this is an area where every Webmaster should wake up and smell the coffee. Nothing is more annoying than visiting dynamically updated pages that don't load in your browser properly and then having to turn off browser caching to accommodate the Web site. Instead of making users suffer, Webmasters should properly manage content with meta tags, telling browsers when to request newer versions of pages, when not to cache pages, and more.

You tell browsers when to request newer versions of pages by setting an expiration date with HTTP-EQUIV="EXPIRES". A request for a page with a valid time results in the page loading from the cache. On the other hand, if the page has expired, the browser makes a new request for the page to see whether it has been modified. Browsers interpret illegal dates as an immediate expiration. To avoid this, dates must be set in RFC850 format, such as

<META HTTP-EQUIV="EXPIRES" 
   CONTENT="Mon, 12 Apr 1999 10:00:00 GMT">

Be careful when using expiration dates. Some indexers delete expired pages from the master index or schedule the page for reindexing. Another way to control caching is to use Pragma with a value of "no-cache", which issues the same request as pressing Reload in your browser. No-cache is the only valid value, and it is used as follows:

<META HTTP-EQUIV="pragma"
CONTENT="no-cache">

Don't you hate it when other sites display your pages inside their frames? A down and dirty way to avoid this is to use Window-target with a value of _top, such as

<META HTTP-EQUIV="Window-target" 
   CONTENT="_top">

The _top value tells compliant browsers to load the page into the top frame set. This prevents the page from appearing within another framed page.

With the Set-Cookie value, you can use meta tags to set cookies in users' browsers. A cookie without an expiration date is temporary and exists only until the user exits the browser. A cookie with a valid expiration date can be used in multiple browser sessions and is saved in the browser's cookie file until it expires. You create a cookie using the following syntax:

<META HTTP-EQUIV="Set-Cookie" 
   CONTENT="name=data; path=path; expires=Day, 
   DD-MMM-YY HH:MM:SS ZON">

where name is the cookie name, data is the cookie value, path is the path within the site where the cookie is valid, and expires sets the expiration date. The following is a real-world example of such a cookie:

<META HTTP-EQUIV="Set-Cookie"
CONTENT="ACCOUNT=9983373; path=/; expires=Thursday, 
20-May-99 00:15:00 GMT">

Meta tags can also be used to rate content for violence, profanity, and other subjects appropriate only for for mature audiences. Two techniques are used: NAME=Rating and HTTP-EQUIV=PICS-Label. Rating is used to assign a simple content rating and has largely been replaced by PICS-Label. Platform for Internet Content Selection (PICS) is an official standard of the Word Wide Web Consortium. With PICS, you can assign rating levels to content in multiple subject areas. For example the page can be designated as containing fighting (a violence rating), mild expletives (a language rating), and no sexual content (a sex rating) but revealing attire (a nudity rating). Usually, ratings are assigned using a third-party rating system, such as that from SafeSurf (www.safesurf.com) or RSACi (www.rsac.org).

PICS labels are very complex, and you don't create the related meta tags by hand. Instead a rating service will help you create the necessary tags. Rating systems have also been integrated into some Web server software, such as Microsoft Internet Information Server.

A final content-management meta tag you'll probably want to use is Refresh. This tag lets you create a slide show by telling browsers when to reload a document and which URL to retrieve when they do. For example, to tell the browser from page0.htm to retrieve page1.htm in 5 seconds, type the following:

<META HTTP-EQUIV="Refresh" CONTENT="5;
 URL=http://www.tvpress.com/page1.htm">

Then in page1.htm, tell the browser to retrieve page2.htm and so on until you complete the slide show. If the last page has a refresh pointing to page0.htm, you can make the slide show repeat.

When you set out to add metainformation to your Web site, start with the home page. After you update the home page and top-level pages, consider adding metainformation to the rest of your site.

Next: Resources

Published as Internet Builder in the 7/1/99 issue of PC Magazine.

 
 Sponsored Links
Wanted  Better hours, more pay! Search here for your new job.
E*TRADE  Learn what Wall Street says about what's hot-FREE!
@Backup  @Backup Lite is absolutely Free. Install here
Very Cool  Wired Home Intro Kit - X10.com
Books  Great Books for $1, while supplies last!
Best PCs  Get a great PC for your money. 500 MHz, $1,699!
 ZDNet Featured Links
Freebies  50 FREE downloads - utilities, screen savers and more!
Bargains!  Shop the Basement for best buys on computer products
Contest!  Enter today to win a FREE digital camera from ZDNet!
 Magazine Offers
Software  Get a FREE CD-ROM from FamilyPC magazine

TOP
Copyright (c) 1999 Ziff-Davis Inc.