wesgi

A WSGI middleware which processes ESI directives
Download

wesgi Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Publisher Name:
  • Brian Sutherland
  • Publisher web site:
  • http://vanguardistas.net

wesgi Tags


wesgi Description

A WSGI middleware which processes ESI directives wesgi implements an ESI Processor as a WSGI middeware. It is primarily aimed at development environments to simulate the production ESI Processor.The relevant specifications and documents are:- http://www.w3.org/TR/esi-lang- http://www.akamai.com/dl/technical_publications/esi_faq.pdfCompletenessThis implementation currently only implements < esi:include >.PerformanceRealistically, under standard Python, WSGI middleware is synchronous. For an ESI Processor to reach very high levels of performance, it is probably necessary for it to be asynchronous. That probably puts an upper limit on the perfomance of this middleware.However, depending on the situation, it may be performant enough.Usage: >>> from wesgi import MiddleWare >>> from wsgiref.simple_server import demo_appTo use it in it's default configuration for a development server: >>> app = MiddleWare(demo_app)To simulate an Akamai Production environment: >>> app = MiddleWare(demo_app, policy='akamai')To simulate an Akamai Production environment with "chase redirect" turned on: >>> from wesgi import AkamaiPolicy >>> policy = AkamaiPolicy() >>> policy.chase_redirect = True >>> app = MiddleWare(demo_app, policy=policy)If you wish to use it for a production server, it's advisable to turn debug mode off: >>> app = MiddleWare(demo_app, debug=False) Requirements: · Python What's New in This Release: Features: · Add wesgi.filter_app_factory which can be used by Paste to configure wesgi as a filter_app_factory. · A max_object_size option for wesgi.LRUCache to limit the maximum size of objects stored. · Major refactoring to use httplib2 as the backend to get ESI includes. This brings along HTTP Caching. · A memory based implementation of the LRU caching algoritm at wesgi.LRUCache. · Handle ESI comments. Bugfixes: · Fix bug where regular expression to find src:includes could take a long time. · Sigh. Add MANIFEST.in so necessary files end up in the tarball.


wesgi Related Software