<?xml version="1.0"?>
<component name="org.nuxeo.drive.cache">

  <#if "${nuxeo.redis.enabled}" == "true"  && "${nuxeo.cache.type}" == "redis">
    <#assign className = "org.nuxeo.ecm.core.redis.contribs.RedisCache" />
  <#else>
    <#assign className = "org.nuxeo.ecm.core.cache.InMemoryCacheImpl" />
  </#if>

  <extension target="org.nuxeo.ecm.core.cache.CacheService" point="caches">

    <cache name="driveSyncRoot" class="${className}">
      <option name="maxSize">10000</option>
      <option name="concurrencyLevel">4</option>
      <ttl>1</ttl>
    </cache>

    <cache name="driveCollectionSyncRootMember" class="${className}">
      <option name="maxSize">10000</option>
      <option name="concurrencyLevel">4</option>
      <ttl>1</ttl>
    </cache>

    <cache name="driveDescendantsScroll" class="${className}">
      <ttl>${nuxeo.cache.ttl}</ttl><!-- minutes -->
      <option name="maxSize">${nuxeo.cache.maxsize}</option>
      <option name="concurrencyLevel">${nuxeo.cache.concurrencylevel}</option>
    </cache>

  </extension>

</component>

