ezsystems/ezplatform-http-cache

HTTP cache handling for eZ Platform.

Installs: 520 235

Dependents: 26

Suggesters: 0

Security: 0

Stars: 47

Watchers: 20

Forks: 21

Type:ezplatform-bundle


README

Build Status Downloads Latest release License

Ibexa HTTP Cache

Provides HTTP cache handling for Ibexa DXP and Ibexa Open Source (formerly eZ Platform), by default since version 1.12. It adds support for multi-tagging for Symfony Proxy, Varnish (using xkey). Support for Fastly is part of the Ibexa Cloud offer.

Usage with Varnish

For usage with Varnish see the dedicated document in docs/varnish

Features

xkey header on ContentView responses

Responses from /content/view will be tagged based on their contents:

curl -i -X HEAD 'http://localhost:8000/'

HTTP/1.1 200 OK
Host: localhost:8000
Connection: close
Cache-Control: public, s-maxage=60
Content-Type: text/html; charset=UTF-8
Vary: X-User-Context-Hash
xkey: ez-all c1 ct1 l2 pl1 p1 p2

If you have several repositories configured, the tags will be prefixed by repository "index" on non default repository. E.g. "1p1", where repository is the second repository in the system (default repository has index 0 but does not have prefix).

For further reading on tags see docs/using_tags.md.

Toggling of cache on ContentView responses

Responses from /content/view will be made cachable, and the shared max age will be set if it is enabled.

Purging of tagged HTTP cache on Repository operations

A set of Slots will send HTTP PURGE requests for each cache tag affected by write operations.

Configuration

Drivers

This bundle lets you configure drivers for handling HTTP cache. The following exists from eZ:

  • local: extended Symfony Proxy to support tagging and varying by user rights (available in this bundle)
  • varnish: Varnish proxy using and customizing FosHttpCache for purging (available in this bundle)
  • fastly: Fastly CDN proxy (available with eZ Platform Enterprise and documented separately)

Configuring these is done using global ezpublish.http_cache.purge_type config. By default it is set to use %purge_type% parameter, and can be set in app/config/parameters.yml like so:

parameters:
    purge_type: varnish

For further reading on drivers see docs/drivers.md.

Tags

For further reading on tags see docs/using_tags.md.

COPYRIGHT

Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved.

LICENSE

This source code is available separately under the following licenses:

A - Ibexa Business Use License Agreement (Ibexa BUL), version 2.3 or later versions (as license terms may be updated from time to time) Ibexa BUL is granted by having a valid Ibexa DXP (formerly eZ Platform Enterprise) subscription, as described at: https://www.ibexa.co/product For the full Ibexa BUL license text, please see: https://www.ibexa.co/software-information/licenses-and-agreements (latest version applies)

AND

B - GNU General Public License, version 2 Grants an copyleft open source license with ABSOLUTELY NO WARRANTY. For the full GPL license text, please see: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html