Jetty Logo
Version: 9.4.31.v20200723
Contact the core Jetty developers at

private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development

Persistent Sessions: The L2 Session Data Cache


If your chosen persistence technology is slow, it can be helpful to locally cache the session data. The CachingSessionDataStore is a special type of SessionDataStore that locally caches session data, which makes reads faster. It writes-through to your chosen type of SessionDataStore when session data changes.


The MemcachedSessionDataMap uses memcached to perform caching.

To enable it with the Jetty distribution, enable the session-store-cache module, along with your chosen session-store-xxxx module, and optionally the session-cache-hash or session-cache-null modules.

After enabling, the $jetty.base/start.d/session-store-cache.ini file will be generated:


## Session Data Cache type: xmemcached

The configuration properties are:
Default value is localhost. This is the host on which the memcached server resides.
Default value is 11211. This is the port on which the memcached server is listening.
Default value 0. This is the length of time in seconds that an item can remain in the memcached cache, where 0 indicates indefinitely.
Default value true. Whether or not the memcached system should generate heartbeats.

See an error or something missing? Contribute to this documentation at Github!(Generated: 2020-07-23)