Try Playground
Show / Hide Table of Contents

Custom Cache Data Dependencies [Deprecated]

NCache provides flexible ways to determine data invalidation using various dependencies. However, you can implement your custom logic for dependency if none of the built-in invalidation strategies fulfill your requirements.

In custom dependency, you can implement your custom logic which defines when certain data becomes invalid. Here, the concept of multithreading is incorporated, meaning that instead of executing each item sequentially, multiple threads perform expiration simultaneously. For example, you can implement a custom dependency that makes a call to a web service for the validation of data depending on your application's functionality.

Custom Cache Dependencies in NCache

There are three distinct custom dependency classes provided to you by NCache. The first one is known as ExtensibleDependency class that allows you to implement your custom expiry logic against which data is expired one item at a time. All you need to do is inherit your dependency class from ExtensibleDependency and override its HasChanged property.

The second class is BulkExtensibleDependency which allows multiple expirations against one call. Instead of the HasChanged property, the Bulk Extensible Dependency provides an alternate EvaluateBulk method that evaluates multiple items at a time.

The third dependency class provided by NCache is NotifyExtensibleDependency, where the user is responsible for providing the dependency logic that calls a delegate provided by NCache to invoke that logic to remove data from the cache.

Like expiration, the cache cleanup thread periodically calls the HasChanged property and EvaluateBulk method, and on returning true, the items are removed from the cache. The NotifyExtensibleDependency, however, doesn’t depend on the cleanup thread for removing items from the cache. It deploys its own handler on the cache that is responsible for removing items from the cache.

See Also

Sync Cache using Bulk Extensible Dependency
Sync Cache using Notify Extensible Dependency

In This Article
  • Custom Cache Dependencies in NCache
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top