Raven.Client.Shard.ShardedDocumentStore.AggressivelyCacheFor C# (CSharp) Method

AggressivelyCacheFor() public method

Setup the context for aggressive caching.
aggressive caching means that we will not check the server to see whatever the response we provide is current or not, but will serve the information directly from the local cache without touching the server.
public AggressivelyCacheFor ( System.TimeSpan cacheDuration ) : IDisposable
cacheDuration System.TimeSpan Specify the aggressive cache duration
return IDisposable
		public override IDisposable AggressivelyCacheFor(TimeSpan cacheDuration)
		{
			var disposables =
				ShardStrategy.Shards.Select(shard => shard.Value.AggressivelyCacheFor(cacheDuration)).ToList();

			return new DisposableAction(() =>
			{
				foreach (var disposable in disposables)
				{
					disposable.Dispose();
				}
			});
		}