Questions tagged [cache-dependency]

29 questions
11
votes
2 answers

Is there some sort of CacheDependency in System.Runtime.Caching?

I heard that .NET 4 has a new caching API. Okay, so the good old System.Web.Caching.Cache (which is, by the way, still there in .NET 4) has the ability to set so-called CacheDependency objects to determine whether a cached item is expired or…
Venemo
  • 18,515
  • 13
  • 84
  • 125
8
votes
3 answers

SQLCacheDependency and AppFabric Server

I have a situation where I need to replace our current file based cache dependency system with a new one. What I am looking at is moving towards using AppFabric for caching. I was wondering if the SQLDependencyCaching technique where the table…
bechbd
  • 6,206
  • 3
  • 28
  • 47
6
votes
1 answer

CacheDependency from 2 or more other cache items. (ASP.NET MVC3)

I'm a little puzzled over the possible cachedependencies in asp.net, and I'm not sure how to use them. I would like to add items to the HttpRuntime.Cache in a way, that the elements should invalidate if I change other elements in the cache. The…
vinczemarton
  • 7,756
  • 6
  • 54
  • 86
5
votes
1 answer

ASP.Net CacheDependency object question

I think I know the answer to this but I cannot find a definitive yes or no anywhere in documentation or articles. Using .Net 3.5 ASP.Net caching, if you make a CacheDependency passing a string[] of cacheKeys, do those passed cacheKeys get inserted…
Billyhole
  • 1,688
  • 3
  • 20
  • 32
3
votes
2 answers

Problem with ASP.NET Caching

I've got two items in my cache Key: Cat Key: Animal_Vacinations Now, Animal_Vacinations has a key-based cache dependency on Cat. So, if anything changes for the cache item Cat, then the cache item Animal_Vacinations get invalidated. PERFECT…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
3
votes
1 answer

Strange behaviour when loading razor view from custom VirtualPathProvider (ASHX Source)

I get some strange behaviour when I load data via my custom VirtualPathProvider. It might be important to mention, that I am trying to use this view as a layout. public class MyVirtualPathProvider : VirtualPathProvider { public…
Dänu
  • 5,791
  • 9
  • 43
  • 56
2
votes
0 answers

Gradle resolution strategy cacheDynamicVersionsFor isn't working

I want to push Gradle to redownload my SNAPSHOT dependencies every time. It's possible to do it via --refresh-dependencies. But I want to do it programmatically in a next way: configurations.all { resolutionStrategy.cacheDynamicVersionsFor 0,…
2
votes
2 answers

C# Caching use of cache dependency

I am trying to implement caching in an web application. The caching is to be done in the BLL. The BLL method signiture is public static List Select(List filters) and at the moment simply calls the corresponding method in the…
Ant Swift
  • 20,089
  • 10
  • 38
  • 55
2
votes
1 answer

ASP.NET set cache dependency with a SqlCommand

Is this an effective way to set the cache item dependent on the query? HttpRuntime.Cache.Insert( "ListLanguages", list, new SqlCacheDependency(command), …
Fabio Milheiro
  • 8,100
  • 17
  • 57
  • 96
2
votes
2 answers

Delegate for Cache.Insert

I want to be able to pass in my actual parsing function in my cache update callback. How can I optimize my code duplication below using delegates? Thanks //intial setup code public void getJSONContent() //can I pass itemUpdateCallback in here? Does…
River
  • 1,487
  • 3
  • 15
  • 25
1
vote
1 answer

Value stored in session depends on value in HttpRuntime cache

I have data common for all users stored in HttpRuntime.Cache. Then I have some user related data stored in Session. HttpRuntime.Cache has CacheDependency mechanism, which can be used to define relationships between the items in cache. What would…
1
vote
1 answer

Apply NCache to existing project (with CacheDependency)

Help/Answers in C# or VB.net are fine I have a large project that currently uses system.web.Caching.CacheDependency, example Dim myCacheDep as new CacheDependency(FilePath) HttpRuntime.Cache.Insert(key, value, myCacheDep) Now, i am trying to setup…
treendy
  • 443
  • 3
  • 16
1
vote
1 answer

.NET Cross platform cache dependency

What would one recommend as a cross platform cache dependency? Our application may use multiple database platforms (e.g. MSSQL and MySQL) so this rules out Sql Cache Dependency. I had thought about using a file cache dependency and just touching the…
Ben Foster
  • 34,340
  • 40
  • 176
  • 285
1
vote
1 answer

How can I put a log whenever compiler recompiles my razor view via VirtualPathProvider?

I'm having a bit performance problem here: the code below is part from my custom VirtualPathProvider, I've overwritten the GetCacheKey, and GetCacheDependency so they can cache my razor views properly. public override string GetCacheKey(string…
1
vote
2 answers

CacheDependancy for multiple Cached items

I would like to have an item in the ASP.NET CacheObject, which if it were changed a number of dependant items would be removed So.. In a request If prompted and it exists in the cache remove the root object, all dependence will be removed too Check…
Anthony Johnston
  • 9,405
  • 4
  • 46
  • 57
1
2