Baldur Kristinsson > Plack-Middleware-ESI-0.1 > Plack::Middleware::ESI

Download:
Plack-Middleware-ESI-0.1.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.1   Source  

NAME ^

Plack::Middleware::ESI - PSGI middleware for Edge Side Includes (ESI)

VERSION ^

version 0.1

SYNOPSIS ^

  use Plack::Builder;

  my $app = sub {
      return [
        200,
        [ 'Content-Type' => 'text/plain' ],
        [
          "The Google front page as plaintext: ",
          '<esi:include src="http://google.com/" />',
          "And a local request might be nice: ",
          '<esi:include src="/userinfo/" />',
        ]
      ];
  };

  builder {
      enable "ESI";
      $app;
  };

DESCRIPTION ^

This module provides rudimentary support for using Edge Side Includes in PSGI applications.

The primary aim is to support the same subset of features as the Varnish caching proxy server. Essentially, this means support for three ESI tags:

The module only filters responses with a Content-Type of text/*, application/xml, or application/xhtml+xml. This obviously means that the Content-Type output header must have been set further down in the middleware stack (or, of course, in the original PSGI app itself), before the ESI middleware is applied.

AUTHOR ^

Baldur Kristinsson <bk@mbl.is>

SEE ALSO ^

syntax highlighting: