asp.net - Creating a custom cachedependency for documents in ravendb -


i'm trying create cache dependency expire documents i'm caching using asp.net cache. came this:

public class documentcachedependency : cachedependency {     private readonly idisposable _subscription;      public documentcachedependency(idocumentstore store, string docid)     {         _subscription = store.changes().fordocument(docid).subscribe(ondocumentchanged);         finishinit();     }      private void ondocumentchanged(documentchangenotification documentchangenotification)     {         notifydependencychanged(this, new eventargs());     }      protected override void dependencydispose()     {         _subscription.dispose();         base.dependencydispose();     } } 

is idea performance wise or should use "fordocumentsstartingwith" / "foralldocuments". or should create index. answer depends on number of documents being cached, guess i'm asking is, ravendb optimizing me out of box when register hundreds of change listeners, or client set hunderds of connections db way.

you better off not doing @ all. ravendb going caching without cost on end.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -