Cloaking
As soon as you mention idea of page cloaking you can be sure that someone somewhere is going to jump to conclusion that you intend to cheat search engines. There is no denying fact that search engine spammers have used page cloaking in past, and that reputation of cloaking has been damaged as a result. The fact remains however that there are still many legitimate reasons for wanting to dabble in various forms of page cloaking, so don't be too quick to judge!
What is Page Cloaking
Page cloaking is practice of altering contents of a page depending on software, method and/or IP address being used to access it. Cloaking has been made possible through use of server side technologies such as ASP and PHP (amongst others), and has been abused so much in past that it will probably never shake off it's bad reputation.
Cloaking is used in all manor of situations, some of them you won't even be aware of until it is pointed out to you. I'll admit to using it on my own site, and I'm not ashamed of fact either!
Cloaking Methods
There are several different ways of implementing cloaking; each is based on environment variables that are passed to server as part of actual request.
What browser/program is making request? (HTTP_USER-AGENT)
What IP address are they trying to connect from? (REMOTE_HOST)
What page (if any) did they come from? (HTTP_REFERER)
Did they recently request a page? Have they already set preferences? (Session data)
While environment variables available to us can be used independently to make generalizations and educated guesses, they become powerful customization tools when combined.
By identifying program used to make request, we get an idea of how data will be used and capabilities of browser. Suddenly we can use specialized page designs without having to use or redirect users to different URLs depending on what they could handle. It can also prove an effective way to reduce needless data transfer costs; by sending only code browser or bot will understand.
When we want to target groups of users based on their geographical location or connection speed, we can use IP addresses to make an educated guess. Different ISPs will own different IP blocks; these ISPs may operate in a specific region or offer only broadband services. While gathering and maintaining current IP data can be a chore, it is probably best way to get information on location of user without specifically asking them.
The use of referral or session data is probably most interesting area of cloaking however, as this is where we can learn more about person making request. With a little research, you can match visitor types by sites they come from and tailor site to their needs. Referral and session data can tell us a lot about visitor without actually needing to identify them; possibilities are limited only by imagination!
Why use Cloaking?
There are many different reasons why people want to use page cloaking, and while some of these can be devious in nature, others are designed to be helpful or to standardize user experience. Some reasons for using page cloaking include: -
To serve known search engine bots with content optimized for best results.
To hide real keywords and text used for rankings from normal visitors.
To alter identity of site depending on who accessed it.
To protect server and it's contents from malicious bots or misuse. To re-brand shared content depending on domain name used to access it. To limit options available depending on browser features or capabilities.
To iron out browser inconsistencies.
To serve relevant information to user based on Operating System and/or browser.
To create a more personalised experience for visitor.
You see page cloaking is perhaps more common than you first think, and when you look at whole picture it doesn't seem as bad as some people make it out to be. It's not so much whether or not you use it, but rather how you use it.
I use ASP and dynamically edit page to show style sheet optimized for browser. Even though my server changes just one line from one browser to next, it is technically page cloaking; style sheet it serves to visitor using Opera is not same style sheet it sends to visitor using Internet Explorer. Ironically, if I chose to use a script on client side to do same thing, it would not be considered to be page cloaking!
So why does it matter where script is executed if they both do same thing?
It's all because we can look at source code of script when it is on client side; thus we can see alternatives that are available simply by looking at way script works. On server side however, all logic is hidden away in some script or server module and we only see results of server's decision; not how it came to conclusion on how it should respond to request.
The Dark side of Cloaking
The use of cloaking is controversial because of way it has been abused in past. Some search engine optimisers use it in their promotional campaigns to serve pages optimised for each of search engines. While this may seem unfair to other site owners fighting for rankings with same keywords, some of arguments for doing so are certainly feasible.
Why increase visitors download time by including Meta tags they don't normally see?
Why send images to search engines when all they really look at is text? Why should they share keyword lists they spend time researching?
All reasons above may seem rather selfish, but just because a Webmaster wants to minimize their data transfer costs and protect investment of their time and effort does not make them an unethical person. Only when topic of alternative pages strays from page visitor sees can practice of optimizing for search engines in this way be deemed to be unethical. There is a fine line between optimizing a page for search engines and misleading them altogether!