Modem-Help Forum Index Main Site
Modems
Downloads
Chips, Chipsets
Help [ Old Help ]
SearchAbuseAggregatorEFG
Modem-Help
Dedicated help on Modems
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Conteg :: Content Negotiation PHP Class :: v0.13.5 released

 
Post new topic   Reply to topic    Modem-Help Forum Index -> Site Info + Diary
View previous topic :: View next topic  
Author Message
Alex Kemp
Site Admin


Joined: 30 Jun 2004
Posts: 5940
Location: Nottingham, England

PostPosted: Mon Oct 08, 2007 7:07 am    Post subject: Conteg :: Content Negotiation PHP Class :: v0.13.5 released Reply with quote


Conteg was made available at PHP Classes (the response was under-whelming) and a support forum was setup there. Whilst my attention was diverted rescuing this site someone called 'Nikita' posted some very useful info with a link on the fact that MSIE 4, 5 and 6 cannot handle the Vary header. It's a mailing-list list, and is a large read. Having got through it, it was clear that Conteg's use of Vary was not compliant.

So, fanfare of Trumpets please for the release of Conteg v0.13.5, with compliant Vary-header handling. The sharp-eyed may also notice that several versions of Conteg have been slipped out without notice. Here are selected comments and Changelog from the Class:

Code:
 *  Vary headers:
 *     By default, a `Vary ' header is sent if the response suffers any form of Content negotiation.
 *     By default, the response is negotiated for `Accept-Encoding', and this is itself varied by User-Agent.
 *     Thus, by default a `Vary: User-Agent, Accept-Encoding' header will ALWAYS be sent. This behaviour is
 *     controlled by the Constructor setup() parameters:
 *
 *       'use_accept'         => FALSE
 *       'use_accept_charset' => FALSE
 *       'use_accept_encode'  => TRUE
 *       'use_accept_lang'    => FALSE
 *       'use_user_agent'     => TRUE
 *       'use_vary'           => TRUE
 *
 *     Setting `use_vary' to FALSE will prevent any `Vary' headers from being sent.
 *     Setting any other of the parameters above to `FALSE' will switch off Content Negotiation for that
 *     specific Request header, although the value of the header is still reported.
 *
 *     Important note: MSIE 4.x throws a (false) error message with Vary headers.
 *                     MSIE 5 + 6 will refuse to cache content (no 304s) for any except `Vary: User-Agent'.

 *  Change Log:
 *    0.13.5:  Bugfix: use of `Vary:' header made compliant; added        08 Oct 07
 *            +$_noUserAgent, $_noVary + setup() parameters 'use_user_agent'
 *            +'use_vary' (both TRUE by default).
 *    0.13.4:  Bugfix: _initRequest() for non-std Q-values                07 Sep 07
 *    0.13.3:  Bugfix: removed duplicate $if_match declaration; added     07 Jul 07
 *            +$file + $line to headers_sent() for better bug-catching.
 *    0.13.2:  Bugfixes to charsetAccepted() + mediaTypeAccepted()        30 Apr 07
 *    0.13.1:  Added 'cpu_number' to Constructor parameter ($_num_cpu)    05 Mar 07
 *            +bugfix for $referer (['uri'] not included in array)
 *    0.13:    Added $referer, getReferer(), '404_to_410', $_no410,       18 Feb 07
 *            +'http_status', $_httpStatus, 'msie_error_fix',
 *            +$_noMSErrorFix + sendStatusHeader() bugfix.
 *             See also http://forums.modem-help.co.uk/viewtopic.php?t=670

 * Constructor parameter array
 *
 *  These are all the possible array values within the single parameter supplied to
 * +the constructor, and acted upon within setup(), with defaults.
 *  Note: none of the following is required - these are the program defaults:
 *
 array(
   '404'                => FALSE,                           // higher precedence than 'http_status'
   '404_to_410'         => TRUE,                              // see sendStatusHeader()
   'cache_control'      => array( 'macro' => 'cache-all' ),   // see setup()
   'charset'            => 'ISO-8859-1',
   'cpu_number'         => 1,                                 // number of CPUs in server
   'dupe_status_header' => TRUE,                              // see sendStatusHeader()
   'encodings'          => array( 'gzip','deflate','compress' ),
   'etag'               => '',
   'expiry'             => 3600,                              // secs after time()
   'http_status'        => NULL,                              // preferred to program-decided status
   'input'              => 'instream',                        // Apache-Notes
   'lang'               => 'en',
   'modified'           => NULL,                              // sets $last_modified to time()
   'msie_error_fix'     => TRUE,                              // avoid MSIE `friendly` error pages
   'noprint'            => FALSE,
   'other_var'          => '',                              // extra string to affect (weak) ETag
   'output'             => 'outstream',                     // Apache-Notes
   'prefer'             => array(),
   'ratio'              => 'ratio',                           // Apache-Notes
   'referer_lower_case' => TRUE,
   'search'             => array(),
   'type'               => 'text/html',
   'use_accept'         => FALSE,
   'use_accept_charset' => FALSE,
   'use_accept_encode'  => TRUE,
   'use_accept_lang'    => FALSE,
   'use_accept_ranges'  => FALSE,
   'use_apache_notes'   => FALSE,
   'use_content_lang'   => TRUE,
   'use_content_type'   => TRUE,
   'use_etag'           => FALSE,
   'use_user_agent'     => TRUE,
   'use_vary'           => TRUE,
   'weak_etag'          => TRUE
 )

One of the Windows XP Service-Packs fixed the MSIE 6 issue with Vary (finally), but all other versions will refuse to allow 304 responses when previously-requested pages are re-requested. MSIE 4.x dies with an erroneous error message.

My personal decision on this is to continue to send Vary headers, so that all the Proxies can get it right. Content-Encoding (gzip compression) allows an average 76% compression--that is a reduction to one quarter of the original size--across this site. Some of the larger pages approach a ten-fold reduction. That is good enough to put up with the loss of some 304s. The situation will continue to improve as people continue to replace MSIE, or upgrade version.

Others may have a different view; hence, use of the Vary header can now be switched off.

2009-04-16 Edited by AK
Edit Reason: Fixed URLs

_________________
Alex Kemp
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Modem-Help Forum Index -> Site Info + Diary All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2007 phpBB Group