anchor.diff:  include::{sourcedir35}/impl/src/test/java/org/ehcache/docs/GettingStarted.java[tag=expiry]
   ----
   
  -<1> Expiry is configured at the cache level, so start by defining a cache configuration,
  -<2> then add to it an `Expiry`, here using the predefined _time-to-live_ one, configured with the required `Duration`.
  +<1> Expiry policy is configured at the cache level, so start by defining a cache configuration,
  +<2> then add to it an `ExpiryPolicy`, here using the predefined _time-to-live_ one, configured with the required `Duration`.
   
   [source,xml,indent=0]
   ----
  
positive.code: 
  Also when used from XML, Ehcache expects your expiry implementation to have a _no-arg_ constructor.
  
  Once you have implemented your own expiry, simply configure it.
  
  In Java:
  
  
negative.code: time-to-live:: this means cache mappings will expire after a fixed duration following their creation,
  time-to-idle:: this means cache mappings will expire after a fixed duration following the time they were last accessed.
  
  For Java, see `org.ehcache.config.builders.ExpiryPolicyBuilder` and the XSD for XML.
  
  Read on to implement your own expiration scheme.
  
  == Custom expiry
  
  Supporting your own expiration scheme simply means implementing the `ExpiryPolicy` interface:
  
  [source,java,indent=0]
  ----
  include::{sourcedir35}/api/src/main/java/org/ehcache/expiry/ExpiryPolicy.java[lines=21..-1]
  ----
  
  The main points to remember on the return value from these methods:
  