This API documentation is for Ballerina 1.2.0. View API documentation for the latest release.

Record - cache : CacheConfig

Represents configurations for the cache:Cache object.

Closed record


  • capacity int (default 100)
  • Maximum number of entries allowed in the cache

  • evictionFactor float (default 0.25)
  • The factor by which the entries will be evicted once the cache is full

  • defaultMaxAgeInSeconds int (default -1)
  • The default value in seconds which all the cache entries are valid. '-1' means, the entries are valid forever. This will be overwritten by the the maxAgeInSeconds property set when inserting item to the cache

  • cleanupIntervalInSeconds int
  • Interval of the timer task, which will clean up the cache