Pluggdapps

Component system. Web framework. And more ...

gzip – Outbound transform for gzip content-encoding.

Module contents

class pluggdapps.web.gzip.GZipOutBound(pa, *args, **kwargs)[source]

Bases: pluggdapps.plugin.Plugin

Out-bound transformer to compress response entity using gzip compression technology. Performs gzip encoding if,

  • b’gzip’ is in content_encoding response header.
  • if type in content_type response header is text or application.
  • if content_type response header do not indicate that data is already compressed variant.

If data successfully gets gzipped, then etag response header value is suffixed with b’;gzip’.

If gzip encoding is not applied on data, it is made sure that content_encoding response header does not contain b’gzip’ value,

transform(request, data, finishing=True)[source]

pluggdapps.web.interfaces.IHTTPOutBound.transform() interface method.