Skip to main content

A WSGI middleware which processes ESI directives

Project description

This package 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:

Completeness

This implementation currently only implements <esi:include>.

Performance

Realistically, 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_app

To 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)

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

wesgi-0.5.tar.gz (5.8 kB view hashes)

Uploaded Source

Supported by

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