Skip to main content

WSGI middleware for statistical HTML browser resource squeezing.

Project description

This package provides a WSGI middleware component which “squeezes” HTML documents by merging browser resources (javascript and stylesheets).

It uses statistical analysis to determine the optimal bundles based on the HTML documents that pass through it. Vary-headers are observed, as are resource expiration dates.

Documents that are not squeezed are given the ‘no-cache’ pragma in an expectation that we will be able to squeeze it after sufficient burn-in. Squeezed documents are served with expiration dates no later than the expiration dates of the squeezed resources which it references.

Usage

The middleware requires two following options to be set:

@cache_dir: Relative path to a directory where we store squeezed resources

@url_prefix: Path segment or full base URL that will be used to serve the cache directory as static files.

Remember to configure a WSGI application to serve the squeezed resources!

Changelog

0.4.2 (released 2009-05-11)

  • Add semicolon after javascripts to make sure any function-block is properly terminated (necessary due to concatenation). [malthe]

0.4.1 (released 2009-04-20)

  • Parse unicode body to ensure correct character decoding. [malthe]

0.4 (released 2009-04-15)

  • If a response has status ‘304 Not Modified’, update the ttl but not the content. [malthe]

  • If a script- or style-tag does not have a source or link, ignore it. [malthe]

  • Unquote request URL when querying cache. [malthe]

  • Added support for repoze.xmliter which allows reusing an lxml document tree between middlewares. [malthe]

  • Media types for stylesheets are now taken into account when merging the resources. Squeze uses CSS2 @media <type> syntax. [jvloothuis]

0.3 (released 2008-10-08)

  • Relative URLs appearing in stylesheets are now made absolute before merging. [malthe]

0.2 (released 2008-10-03)

  • Add setuptools as a dependency. [malthe]

0.1 (released 2008-10-02)

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repoze.squeeze-0.4.2.tar.gz (15.6 kB view details)

Uploaded Source

File details

Details for the file repoze.squeeze-0.4.2.tar.gz.

File metadata

File hashes

Hashes for repoze.squeeze-0.4.2.tar.gz
Algorithm Hash digest
SHA256 f142627ebb68d5e30f354ef6371f53042e8037ac96f94ea181110d73070e193e
MD5 7a6c1790010ff58dbac02cb597276aa8
BLAKE2b-256 3ca37e87695d3e641f9177e27c1655d41c565914797fcfc37abd33be96ed5d2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page