Giter Club home page Giter Club logo

drupal-esi-module's Introduction

REQUIREMENTS

Use of the ESI module requires a reverse proxy with ESI support.
Varnish would be a good choice.


USING THE ESI MODULE

The ESI module will replace blocks with ESI include tags - which look like:
<esi:include src="/esi/block/....." />
The reverse-proxy will remove the ESI tags from the page, and replace each one
with the appropriate block content.  The proxy should be configured to cache
the block content appropriately for the block-cache configuration, so that
blocks which change per-user or per-role have separate caches for each context.
The example VCL demonstrates how this is done with Varnish.


ROLE-BASE COOKIES

To support cacheing of role-based blocks, the proxy needs a way of recognising
which roles a user has.  On login, a cookie is set by the ESI module with a
unique hash for each combination of roles; for example, all users who have no
role will have hash a; users who are in role foo (and only role foo) will have
hash b; users who are in role foo and role bar will have hash c; etc.
The proxy has no way of interpreting which roles a user has, but can
distinguish each unique combination of roles.


CONFIGURATION

The module stores 3 variables:
 - esi_seed_key_rotation_interval
   How often the seed key should change (in seconds). Defaults to daily.

 - esi_seed_key_last_changed
   When the seed key was last changed (unix timestamp)

 - esi_seed_key
   The current 'seed' (a 32-character string)

The esi_seed_key_rotation_interval variable may be configured in settings.php.
In most cases, it's best to allow the module to manage the other 2 fields
automatically.


VARNISH VCLs

Two VCLs are provided:
- docs/esi_blocks.vcl
  This VCL provided custom sub-routines to handle ESI-block integration.
  This is designed to be included from another VCL.

- docs/default.vcl
  This is an example default.vcl, showing how the ESI-blocks VCL can be
  included.

drupal-esi-module's People

Contributors

dstuart avatar

Stargazers

Steven Merrill avatar

Watchers

Steven Merrill avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.