Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1966

Show
Ignore:
Timestamp:
05/24/08 12:55:05
Author:
fumanchu
Message:

Doc tweak.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/encoding.py

    r1797 r1966  
    210210 
    211211def gzip(compress_level=9, mime_types=['text/html', 'text/plain']): 
     212    """Try to gzip the response body if Content-Type in mime_types. 
     213     
     214    cherrypy.response.headers['Content-Type'] must be set to one of the 
     215    values in the mime_types arg before calling this function. 
     216     
     217    No compression is performed if any of the following hold: 
     218        * The client sends no Accept-Encoding request header 
     219        * No 'gzip' or 'x-gzip' is present in the Accept-Encoding header 
     220        * No 'gzip' or 'x-gzip' with a qvalue > 0 is present 
     221        * The 'identity' value is given with a qvalue > 0. 
     222    """ 
    212223    response = cherrypy.response 
    213224    if not response.body: 

Hosted by WebFaction

Log in as guest/cpguest to create tickets