[Mono-bugs] [Bug 429926] [Patch] OutputCache doesn't work

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Sep 26 04:58:49 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=429926

User juraj at hotfeet.ch added comment
https://bugzilla.novell.com/show_bug.cgi?id=429926#c5





--- Comment #5 from Juraj Skripsky <juraj at hotfeet.ch>  2008-09-26 02:58:49 MDT ---
(In reply to comment #4 from Marek Habersack)
> > Why is the line "internalCache.DependencyCache = cache;" in HttpRuntime.cs
> I have no idea, I didn't add the code - but looking at it, using cache for
> internalCache's dependency cache is indeed wrong. It should probably be an
> entirely separate Cache instance. This cache is set on dependencies using
> SetCache (see Cache.cs:160), which is why you see HasChanged in Dependency
> using the "normal" cache.

The dependency cache must not be a different instance. Take a look at this
code:

  Cache cache = HttpRuntime.InternalCache;
  cache.Insert("Item1", "dummy1");

  CacheDependency cd = new CacheDependency(null, new string[] {"Item1"});
  cache.Insert("Item2", "dummy2", cd);

  object o = cache["Item2"]

One expects "o" to contain "dummy2" at the end. But as long as
internalCache.DependencyCache is wired to a instance different from
internalCache, it will be null. The lookup for "Item2" checks the dependencies
for "Item2". Those include the key "Item1". But with the DependencyCache wired
to a completely different cache, the item with this key will never be found.


> > I would much prefer to solve this issue first and then make OutputCache use
> > InternalCache for all items. What do you think?
> Let's try setting DependencyCache to 'new Cache ()' in HttpRuntime and use
> InternalCache in OutputCacheModule for everything - please check if your
> scenario works with such changes and, if yes, commit. Thanks!

That does not work, see my explanation above. (I actually tried it just to be
on the safe side.)


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list