Message-ID: <234906791.4396.1485866373979.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_4395_755646397.1485866373978" ------=_Part_4395_755646397.1485866373978 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Purge

Purge

This explains the content cache pu= rge mechanism, while publishing a content from the admin interface or = from a container aware script (will not work with pure eZScript<= /code> atm, but will with new CLI scripts).
Note that the approach = is fully compatible with native reverse proxies like Varnish (but in this case you won't use all HttpCache related code).

Description

On publish, one or several Http PURGE requests are sent to the backend. = This request will have a specific header X-Location-Id&nb= sp;(in the case of 1 request per location to purge) or X-Group-L= ocation-Id (in the case of 1 request for all location to purge)= .

Http PURGE requests

Emulated purge requests

By default, PURGE requests will be emulated and sent to the cache Store.= Cache purge will thus be synchronous.
This is the default behavior.&nbs= p;No Http requests will be sent to the backend when publishing.

Configuration:

ezpublish.yml
=20
ezpublish:
    http_cache:
        purge_type: local
=20

O= ne purge request for all locations, aka "SingleHttp"

Only one Http PURGE request is sent for purging every needed locations.<= /p>

A request for purging locations 123 and 456 would be:

PURGE / HTTP 1.1 
Host: localhost
X-Group-Location-Id: 12= 3; 456

Configuration

ezpublish.yml
=20
ezpublish:
    http_cache:
        purge_type: single_http
=20

One requ= est per location, aka "MultipleHttp"

One Http PURGE request will be sent per location to purge<= /p>

A request for purging locations 123 and 456 would result to:

PURGE / HTTP 1.1 
Host: localhost
X-Location-Id: 123

AND

PURGE / HTTP 1.1 
Host: localhost
X-Location-Id: 456

Configuration:

ezpublish.yml
=20
ezpublish:
    http_cache:
        purge_type: multiple_http
=20

Purge all content

When purging all cached content, a single Http PURGE request is sent (ex= cept for local purge type), withX-Location-Id set to *:

PURGE / HTTP 1.1 
Host: localhost
X-Location-Id: *

Multiple servers

If you need to purge several servers at once (e.g. multiple Varnish infr= astructure), you can set this up in the siteaccess configuration:

ezpublish.yml
=20
ezpublish:
    http_cache:
        purge_type: single_http

    system:
        my_siteacess:
            http_cache:
                purge_servers: ["http://varnish.server1/", "http://varnish.=
server2/", "http://varnish.server3/"]
=20

Manual purging

Manual purging is also possible:

=20
$locationIds =3D array( 123, 456 );
$container->get( 'ezpublish.http_cache.purger' )->purge( $locationIds=
 );
=20

 

 
------=_Part_4395_755646397.1485866373978--