Skip to main content
fixed caching API changes link
Source Link
nickwesselman
  • 5.4k
  • 1
  • 21
  • 62

Low-level API changes are too numerous to document here, but from a high level:

  • The CacheManager has now been abstracted to a BaseCacheManager, in line with many of the other Dependency Injection changes in 8.2.
  • The Cache class has been abstracted to an ICache, allowing for other cache implementations in the future (e.g. Redis).
  • Statics on the Cache class for finding/creating a cache are no longer present -- you must utilize the CacheManager.
  • The base cache implementation can now estimate object sizes itself, and all size arguments have been eliminated from the Add overloads on the cache. So above in your question, you can simply eliminate your third argument. The event handler it is looking for in your compiler error is an optional callback for when the object is removed from the cache.
  • If you really want to handle the size calculation yourself, there is the an ICacheSizeCalculationStrategy, which is set on a property of Cache<T>, but the setter appears to be private at this time. You would need to provide your own ICache implementation. But this really is overkill -- in most production deployments you'll be disabling cache size limitations anyway.

You can find more details on the changesmore details on the changes in the Sitecore documentation.

Low-level API changes are too numerous to document here, but from a high level:

  • The CacheManager has now been abstracted to a BaseCacheManager, in line with many of the other Dependency Injection changes in 8.2.
  • The Cache class has been abstracted to an ICache, allowing for other cache implementations in the future (e.g. Redis).
  • Statics on the Cache class for finding/creating a cache are no longer present -- you must utilize the CacheManager.
  • The base cache implementation can now estimate object sizes itself, and all size arguments have been eliminated from the Add overloads on the cache. So above in your question, you can simply eliminate your third argument. The event handler it is looking for in your compiler error is an optional callback for when the object is removed from the cache.
  • If you really want to handle the size calculation yourself, there is the an ICacheSizeCalculationStrategy, which is set on a property of Cache<T>, but the setter appears to be private at this time. You would need to provide your own ICache implementation. But this really is overkill -- in most production deployments you'll be disabling cache size limitations anyway.

You can find more details on the changes in the Sitecore documentation.

Low-level API changes are too numerous to document here, but from a high level:

  • The CacheManager has now been abstracted to a BaseCacheManager, in line with many of the other Dependency Injection changes in 8.2.
  • The Cache class has been abstracted to an ICache, allowing for other cache implementations in the future (e.g. Redis).
  • Statics on the Cache class for finding/creating a cache are no longer present -- you must utilize the CacheManager.
  • The base cache implementation can now estimate object sizes itself, and all size arguments have been eliminated from the Add overloads on the cache. So above in your question, you can simply eliminate your third argument. The event handler it is looking for in your compiler error is an optional callback for when the object is removed from the cache.
  • If you really want to handle the size calculation yourself, there is the an ICacheSizeCalculationStrategy, which is set on a property of Cache<T>, but the setter appears to be private at this time. You would need to provide your own ICache implementation. But this really is overkill -- in most production deployments you'll be disabling cache size limitations anyway.

You can find more details on the changes in the Sitecore documentation.

Source Link
nickwesselman
  • 5.4k
  • 1
  • 21
  • 62

Low-level API changes are too numerous to document here, but from a high level:

  • The CacheManager has now been abstracted to a BaseCacheManager, in line with many of the other Dependency Injection changes in 8.2.
  • The Cache class has been abstracted to an ICache, allowing for other cache implementations in the future (e.g. Redis).
  • Statics on the Cache class for finding/creating a cache are no longer present -- you must utilize the CacheManager.
  • The base cache implementation can now estimate object sizes itself, and all size arguments have been eliminated from the Add overloads on the cache. So above in your question, you can simply eliminate your third argument. The event handler it is looking for in your compiler error is an optional callback for when the object is removed from the cache.
  • If you really want to handle the size calculation yourself, there is the an ICacheSizeCalculationStrategy, which is set on a property of Cache<T>, but the setter appears to be private at this time. You would need to provide your own ICache implementation. But this really is overkill -- in most production deployments you'll be disabling cache size limitations anyway.

You can find more details on the changes in the Sitecore documentation.