When accessing a site through Baidu on a phone, you’ve probably seen many sites show “This page declares a WAP version; we recommend visiting the mobile page” when redirecting. If you have a corresponding WAP page, you can declare it to Baidu so it prompts users to visit the mobile version. If you don’t, Baidu’s automatic transcoding is actually pretty good.
My blog does have a corresponding WAP page — it’s just a different theme, with no images and faster loading — so I declared to Baidu that my page has a corresponding WAP mobile version, so Baidu recommends users visit the mobile page.
Let’s first look at Baidu’s “Transcoding Declaration”:
1. What is the point of transcoding web pages?
The internet blends two kinds of web resources: WEB and WAP. WEB pages far outnumber WAP pages, but the vast majority of mobile browsers today cannot directly render WEB pages. Therefore, to ensure WAP availability, WEB pages in WAP search results must be converted into WAP pages so they can be viewed in mobile browsers. Baidu’s transcoding technology is a by-product built to serve WAP search for this purpose; all major search engines have similar transcoding technology.
2. What is Baidu’s transcoding strategy?
To maximize the usability of WEB pages on phones, transcoding must strip out content that can’t be rendered in a mobile browser and parts that can’t be described with WAP markup languages, and adapt the page layout from 2D to 1D.
3. Tips for webmasters
(1) If you feel your site’s transcoding result is poor, you can use Baidu’s Mobile Annotation Protocol — add Baidu’s annotation protocol (in comment form) to your PC site’s HTML pages to improve the transcoding result. This protocol mainly targets Web sites built with HTML specifications, helping webmasters optimize how Baidu Wireless Search renders their pages.
(2) If you don’t want your site transcoded, there are three solutions:
A. no-transform protocol
TC supports the no-transform protocol in two forms:
a. Explicitly declare Cache-control as no-transform in the HTTP Response.
b. Explicitly declare Cache-control as no-transform in a meta tag, in this format:
If a third-party site doesn’t want its pages transcoded, it can add this protocol; when a user enters the third-party site, they first land on an intermediate prompt page that guides them to choose whether to jump to the original page.
B. handheld protocol
The page explicitly specifies the WAP page via an lt;link> tag, declared like this:
If a third-party site doesn’t want its pages transcoded, it can add this protocol to tell us the original page has a corresponding WAP version; when a user enters the third-party site, they first land on an intermediate prompt page and can choose to jump to the original page or the third-party site’s own WAP page.
C. User-Agent related
When TC crawls a page, it uses this User-Agent:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; baidu Transcoder;)
If a third-party site doesn’t want its HTML pages transcoded and can provide its own corresponding WAP page, it can return its own WAP page based on this User-Agent, and explicitly declare in the HTTP Response that Content-Type is vnd.wap.xhtml+xml. Then TC won’t transcode the page but will jump directly to the corresponding own WAP page.
OK, since I have a corresponding WAP page, I declared to Baidu that I have one, using B. the handheld protocol. Whether my blog page is the desktop version or the mobile version is controlled by a parameter: ?mobile=1 is the mobile WAP page, ?mobile=0 is the desktop page. Just add <link rel="alternate" type="application/vnd.wap.xhtml+xml" media="handheld" href=<http://www.neilren.com/?mobile=1>/> to the header, and now when someone visits my site through Baidu on a phone, Baidu will prompt them that there’s a corresponding mobile version and recommend they visit it.
If you don’t want Baidu to transcode your pages, you can use A. the no-transform protocol to refuse Baidu’s automatic transcoding — just add one line to your page header: <meta http-equiv="Cache-Control" content="no-transform " />, and after the user clicks, they’ll go straight to your page with no interference from Baidu.
