ГЛАВНАЯ  |  НОВОСТИ  |  О КОМПАНИИ  |  ДОКУМЕНТАЦИЯ  |  СЛОВАРЬ  |  КОНТАКТЫ  
 

 
W3C
Спецификация HTML 4.01 (на русском)
HTML 4.0 Entities
Спецификация CSS2 (на русском)
Расширяемый Язык Разметки (XML) 1.0 (на русском)
Расширяемый Язык Стилей (XSL) 1.0 (на русском)
Расширяемый Язык Гипертекстовой Разметки (XHTML) 1.0 (на русском)
XHTML 1.1 - XHTML на базе модулей (на русском)
Модуляризация XHTML (на русском)
Mason
Документация по Mason (на русском)
Mason Documentation (english)
Embedding Perl in HTML with Mason (english)
Поисковые машины
mnoGoSearch 3.2.15 (на русском)
mnoGoSearch 3.3.7 (english)
RDBMS
PostgreSQL 8.3 Documentation (english)
FreeBSD & UNIX
Manpage Viewer / Страницы помощи (english)
Руководство FreeBSD (на русском)
FreeBSD Handbook (english)
Часто задаваемые вопросы по FreeBSD (на русском)
Frequently Asked Questions for FreeBSD (english)
Статьи о FreeBSD на русском
Другие руководства по FreeBSD (на русском)
Операционная система UNIX (на русском)
Протоколы сетевого взаимодействия TCP/IP (на русском)
VIDEO
MPlayer (mencoder) (на русском)
MPlayer (mencoder) (english)
FFMPEG (english)
GRAPHICS
User manual for Netpbm (english)
O'Reilly
O'Reilly's bookshelves (english)
 

Book HomeApache: The Definitive GuideSearch this book

6.5. Browsers and HTTP/1.1

Like any other human creation, the Web fills up with rubbish. The webmaster cannot assume that all clients will be using up-to-the-minute browsers -- all the old, useless versions are out there waiting to make a mess of your best-laid plans.

In 1996, the weekly Internet magazine devoted to Apache affairs, Apache Week (Issue 25), had this to say about the impact of the then-upcoming HTTP/1.1:

For negotiation to work, browsers must send the correct request information. For human languages, browsers should let the user pick what language or languages they are interested in. Recent beta versions of Netscape let the user select one or more languages (see the Netscape Options, General Preferences, Languages section).

For content-types, the browser should send a list of types it can accept. For example, "text/html, text/plain, image/jpeg, image/gif.". Most browsers also add the catch-all type of "*/*" to indicate that they can accept any content type. The server treats this entry with lower priority than a direct match.

Unfortunately, the "*/*" type is sometimes used instead of listing explicitly acceptable types. For example, if the Adobe Acrobat Reader plug-in is installed into Netscape, Netscape should add application/pdf to its acceptable content types. This would let the server transparently send the most appropriate content type (PDF files to suitable browsers, else HTML). Netscape does not send the content types it can accept, instead relying on the */* catch-all. This makes the transparent content-negotiation impossible.

Although time has passed, the situation has probably not changed very much. In addition, most browsers do not indicate a preference for particular types. This should be done by adding a preference factor (q) to the content type. For example, a browser that accepts Acrobat files might prefer them to HTML, so it could send an accept-type list that includes:

text/html: q=0.7, application/pdf: q=0.8

When the server handles the request, it combines this information with its source quality information (if any) to pick the "best" content type to return.

For another method of handling MIME types, see Section 12.11, "MIME Magic" in Chapter 12, "Extra Modules".



Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.

 
 


 Copyright © DHS Group, 2000-2007.

 
 
E-mail: info@dhs.net.ru 
Тел.: +7 3952 664321