armstrong.esi

Simple template tags for handling edge side include (ESI)
Download

armstrong.esi Ranking & Summary

Advertisement

  • Rating:
  • License:
  • The Apache License 2.0
  • Price:
  • FREE
  • Publisher Name:
  • Bay Citizen & Texas Tribune
  • Publisher web site:
  • http://armstrongcms.org

armstrong.esi Tags


armstrong.esi Description

armstrong.esi is a Django app for handling Edge Side Include (ESI).UsageESI allows you to specify sections of the site that require different caching strategies and can be sent to a smart caching layer for rendering.For example, if you want to send a page that is identical for every user except for a welcome message, you could render that message like:< html > < body > < esi:include "/esi/welcome-message" / > ... the rest of the page ... < /body >< /html >A smart proxy such as Varnish and the middleware included with armstrong.esi can cache this page, and send a request for /esi/welcome-message for personalization. The next user hitting the page would get the cached version and your application server would only need to render /esi/welcome-messagearmstrong.esi provides a template tag for rendering the correct urls with the same syntax as django's url tag. For example, the above example becomes:{% load esi %}< html > < body > {% esi welcome_message %} ... the rest of the page ... < /body >< /html >This replaces our {% esi %} tag with a tag pointing to the URL for that view.Using with VarnishVarnish integrates fairly easily with armstrong.esi. The EsiHeaderMiddleware sets the 'X-ESI' header to 'true' if the page request has esi tags on it. To enable esi processing in varnish for pages that need it, add the following to your vcl_fetch method:if (beresp.http.X-ESI) { set beresp.do_esi = true;}Loading without ESIThe template tag reads the DEBUG settings value and if set to True renders the view with the current request rather than including the < esi:include > tag. This makes it easy to see fully rendered pages in development.Installation & ConfigurationYou can install the latest release of armstrong.esi using pip:pip install armstrong.apps.articlesMake sure to add armstrong.esi to your INSTALLED_APPS. You can add this however you like. This works as a copy-and-paste solution:INSTALLED_APPS += You must also enable the armstrong.esi middleware. To do this, add the following line to your MIDDLEWARE_CLASSES:'armstrong.esi.middleware.EsiMiddleware'Product's homepage


armstrong.esi Related Software