Forum Moderators: coopster

Message Too Old, No Replies

RFC-Compliant Content-Negotiation Class

Announcing availability of this Class: Conteg

         

AlexK

8:51 am on Sep 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



On Aug 7 moon2005 asked is there a HTTP-compliant implementation of If-Modified-Since-, If-Match, If-None-Match, If-Range and so on? [webmasterworld.com] (the thread is now closed, else I would have posted there). He wanted a full- and RFC-Compliant implementation of producing Response headers to client Request headers.

There wasn't. I looked around myself, and could not find any. But needed something like it myself. 8 weeks later it's written and can be found for download [webmasterworld.com].

Here is a snapshot of the Headline content of the Class:

* Conteg.include 
*
* Content-Negotiation for PHP produced web-output
* - Request/Response Headers attempt to be RFC-compliant
* - Compression is load-balanced by default
* - Document-wide multi search/replace available
* - Single array-parameter switches negotiation on/off:
*
* No switches: auto-negotiates Accept-Encoding (compression), User-Agent
* Add:
* +Modified-date: auto-negotiates If-Modified-Since, If-Unmodified-Since
* +Expiry time: auto-sends Expires
* +Etag: auto-negotiates If-None-Match, If-Match, If-Range
* +Ranges: auto-negotiates Range, If-Range
* +Charset: auto-negotiates Accept-Charset
* +Language: auto-negotiates Accept-Language
* +Media-Type auto-negotiates Accept
*
* With the appropriate switches, the routine will auto-send the correct
* +304 Not Modified, 406 Not Acceptable, 412 Precondition Failed, 416 Requested
* +Range Not Satisfiable, 206 Partial content or 200 OK page + full headers.

[edited by: jatar_k at 3:14 pm (utc) on Sep. 22, 2005] made link direct

[edited by: coopster at 2:58 am (utc) on Aug. 6, 2008]

ergophobe

4:26 pm on Sep 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Will you be submitting it to PHPClasses or some other public repository so more people can benefit?

AlexK

4:52 pm on Sep 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hmm, I take it that you mean http://www.phpclasses.org/. No obvious place to submit and, frankly, all my time is consumed trying to finalise my own site update.

Nice idea, though, and the feedback would be valuable.