Spring doesn't offer this out of the box but it supports adapters and you may use for example guava adapter which among other things allows configure expiration timeout.
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
<property name="caches">
<list>
<bean name="testCache"
class="org.hypoport.springGuavaCacheAdapter.SpringGuavaCacheAdapter">
<property name="expireAfterAccessInSeconds" value="10"/>
<property name="expireAfterWriteInSeconds" value="10"/>
</bean>
</list>
</property>
</bean>