Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
   eZ Publish 4.x / legacy

eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Skip to end of metadata
Go to start of metadata

Version compatibility

Compatible with eZ Publish 5.25.3 and 2013.07 (up to 2014.11)


This recipe is deprecated as of 5.4 / 2014.11.
Use user context providers from FOSHttpCacheBundle instead.


Be sure to have read Context aware HTTP cache documentation before reading this recipe.


When user hash generation is requested, eZ Publish will create a hashable User Identity object.

One can add information to the Identity object making the resulted hash vary. This can be done by registering Identity definers.


For this, all you need to do is to declare a service with ezpublish.identity_definer tag. Class for this service must implement eZ\Publish\SPI\User\IdentityAware interface.


services.yml (inside a bundle)

Securing hash generation request

By default, hash generation requests are granted for localhost (

If you want to enlarge the scope (e.g. if your Varnish server is not running on the same machine), you can override canGenerateUserHash() protected method in your main kernel class (mostly EzPublishKernel).

1 Comment

  1. Please ignore if the question/comment is too far off, I'm diving in this topic now but I am not anymore a developer (smile) so I might miss a few things...

    Here are the 2 questions:

    • About Securing hash generation request: is this specific to customized UserHash generation or valid in all cases? If so, might belong more to the main documentation? (Context aware HTTP cache)
    • It seems a fairly usual use case to run Varnish on different machines. Should this kind of setup be possible by configuration and not code?