PHP Classes

Conteg Content Negotiation: Negotiate HTTP Request Response

Recommend this page to a friend!
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 55%Total: 720 This week: 1All time: 4,599 This week: 560Up
Version License PHP version Categories
conteg_include 0.13.7GNU Lesser Genera...4.1.0HTTP
Description 

Author

Conteg is used to negotiate the current HTTP Request response.

Most PHP-produced webpages are slower to arrive at the browser than they need to be. Conteg is designed to auto-allow full use of HTTP Content Negotiation. Even in it's most minimal form--3 lines of code--it will reduce server bandwidth + speed up document delivery three- to five-fold.

Accept-Encoding:
Load-balanced compressed output if the browser accepts it is auto-negotiated by default.

Expires:
Cache-Control:
Last-Modified:
Conteg sends an Expires header of 1 hour by default. Cache-Control + Last-Modified headers can be added by means of setup switches, in which case Conteg will auto-negotiate If-Modified-Since + If-Unmodified-Since, auto-sending a `304 Not Modified' if appropriate.

ETag:
Ranges:
If turned on via setup switches, Conteg will auto-negotiate If-None-Match, If-Match, If-Range + Range, auto-sending `406 Not Acceptable', `412 Precondition Failed', `416 Requested Range Not Satisfiable' or `206 Partial content' if appropriate.

Charset:
Language:
Media-Type:
If turned on via setup switches, Conteg will report these within the document headers. Class functions are provided to allow content negotiation outside the Class.

Conteg reports the Referer, browser User-Agent and Operating System.

The class can also serve custom error-pages, auto-fixed for serving to Microsoft Internet Explorer browsers (404 Not Found, 410 Gone, and other).

3 lines of code to implement on a page. All setup parameters have defaults. All defaults may be changed. < 0.002 secs in typical operation. In use on busy websites right now.

Innovation Award
PHP Programming Innovation award nominee
March 2007
Number 6


Prize: One book of choice by SAMS
HTTP is a protocol that provides several means to negotiate the content that is served.

Negotiating content provides several ways to save bandwidth and server CPU usage by either skip serving cached content or compress the content before serving.

This class can be use to perform several content negotiating actions, thus simplifying the process of making Web applications more efficient.

Manuel Lemos
Picture of Alex Kemp
Name: Alex Kemp <contact>
Classes: 1 package by
Country: United Kingdom
Age: 74
All time rank: 2793128 in United Kingdom
Week rank: 411 Up12 in United Kingdom Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Accessible without login Plain text file Intro.0.13.txt Doc. Introduction to Conteg, and to Content Negotiation + Cache-Control.
Accessible without login Plain text file how-to.0.13.txt Doc. Basic implementation using Conteg, including coding examples.
Accessible without login Plain text file custom-error-howto.0.13.txt Doc. Info + brief How-To on creating custom error pages, including coding examples.
Accessible without login Plain text file php-with-html-plus...otes-howto.0.13.txt Doc. Brief How-To on using Conteg to restore Content-Negotiation with disk-files when processed through PHP, plus logging Compression stats with Apache, including coding examples.
Plain text file Conteg.include.0.13.7 Class Complete include file for the Class (Plain text, Unix LF)

 Version Control Unique User Downloads Download Rankings  
 0%
Total:720
This week:1
All time:4,599
This week:560Up
 User Ratings  
 
 All time
Utility:81%StarStarStarStarStar
Consistency:75%StarStarStarStar
Documentation:75%StarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:55%StarStarStar
Rank:1913