jsr107/jsr107spec — Issue #27: Expiration API as proposed imposes significant latency/size cost
Author: yannis666
Created: 2011-10-10 17:57:49+00:00
State: open

A significant set of uses cases do not use cache expiration. This can be indicated in the API by setting Duration.ETERNAL.
The current API allows for dynamic changing of the expiration. To cater for this an implementation must keep modification/access times for all entries, even if the cache was created with Duration.ETERNAL. This imposes non trivial cost in time and space.

There are 2 possible solutions to this.
1) make Duration non dynamic (settable only at create time)
2) special case Duration.ETERNAL at create time to dissallow future changes (e.g. throw InvalidArgument if an attempt is made to change)

Personally I prefer (1)