All Versions
Latest Version
Avg Release Cycle
115 days
Latest Release
550 days ago

Changelog History
Page 2

  • v2.2.0 Changes

    January 01, 2021

    API changes:

    • #37 : a GetMetrics call is now available for some information on hits/misses etc.
    • #34 : Errors are now const
  • v2.1.0 Changes

    October 01, 2020

    2.1.0 (October 2020)

    API changes

    • SetCacheSizeLimit(limit int) a call was contributed to set a cache limit. #35
  • v2.0.0 Changes

    July 01, 2020

    2.0.0 (July 2020)

    ๐Ÿ›  Fixes #29, #30, #31

    Behavioural changes

    • ๐Ÿšš Remove(key) now also calls the expiration callback when it's set
    • Count() returns zero when the cache is closed

    API changes

    • SetLoaderFunction allows you to provide a function to retrieve data on missing cache keys.
    • ๐Ÿšš Operations that affect item behaviour such as Close, Set, SetWithTTL, Get, Remove, Purge now return an error with standard errors ErrClosed an ErrNotFound instead of a bool or nothing
    • ๐Ÿ‘• SkipTTLExtensionOnHit replaces SkipTtlExtensionOnHit to satisfy golint
    • The callback types are now exported
  • v1.7.0 Changes

    July 22, 2020

    ๐Ÿš€ This release has two points:

    • โœ‚ Remove vendoring and continue with modules only. I consider this not breaking as this is a possibility since Go 1.11 and is not an issue on the current Go 1.13 and 1.14 build.
    • ๐Ÿ›  Fixed issue #28: call expirationCallback automatically on cache.Close()

    Note that while all expirationCallback routines are called for all items in the cache on cache.Close() there is no synchronized wait. This is the current behavior for expiration at runtime. It's up to the cache creator to decide whether to built in synchronization for a full clean shutdown. See TestCache_ExpirationOnClose(t *testing.T) for a sample with synchronization.

  • v1.6.0 Changes

    October 15, 2019

    In issue #23 it became clear that people want create and drop caches on the fly. There was a goroutine leak in that case.

    • ๐Ÿ›  The goroutine leak is fixed, after calling Close, an empty cache remains.
    • โœ… Tests are now done with uber goroutine leak detector.
    • โœ… Test logging has been cleaned.
    • ๐Ÿ— 100% coverage, not by synthetic testing but by building up the test suite with seen issues over time.
  • v1.5.0 Changes

    June 17, 2019

    ๐Ÿ›  Depending on your usage, the issues fixed may improve stability of your programs:

    ๐Ÿ”ง #20 : A crash was observed by me in a configuration that was not in the test suite. This subsequently triggered some rework on the locking.

  • v1.4.0 Changes

    April 29, 2019

    ๐Ÿ›  Depending on your usage, the issues fixed may improve stability of your programs:

    ๐ŸŽ #17 : Fixes a data race on read and introduces RWLock which is better for performance on heavy workloads.
    โฌ†๏ธ #18 : Addresses excessive memory usage if you have a long running timer as global TTL. if pprof shows most of your memory in use coming from ttlcache then you must upgrade:

          flat flat% sum% cum cum% calls calls% + context        
                                             1034.31MB 100% |*Cache).startExpirationProcessing
      983.58MB 82.74% 82.74% 1034.31MB 87.00% | time.NewTimer
                                               50.73MB 4.90% | time.startTimer
  • v1.3.0 Changes

    March 27, 2019

    ๐Ÿ›  Fixes issue #15 - checkExpireCallback doesn't work when skipTtlExtension is enabled.

  • v1.2.0 Changes

    September 08, 2018

    โšก๏ธ This fixes issue #12 and updates the Travis CI to current go versions.

    SkipTtlExtensionOnHit allows the user to change the cache behaviour. When this flag is set to true it will
    no longer extend TTL of items when they are retrieved using Get, or when their expiration condition is evaluated using SetCheckExpirationCallback.

  • v1.1.1 Changes

    September 08, 2018

    ๐Ÿ›  This fixes issue #14, which can occur when using SetCheckExpirationCallback and it returns false on the last element in the list.