3

I know SysCache uses ASP caching under the hood, but since I'm not aware of the implementation of the ASP cache (and if it depends on anything IIS), I was wondering if SysCache would work in a non-web application (like a Windows Service)?

Activating it and using NHprofiler seems to show it is not.

lsalamon
  • 7,998
  • 6
  • 50
  • 63
Khash
  • 2,500
  • 4
  • 30
  • 56
  • here you have some options for 2nd level cache. http://nhforge.org/doc/nh/en/index.html#caches – Claudio Redi Apr 03 '10 at 20:01
  • See duplicate: http://stackoverflow.com/questions/12025894/can-i-use-nhibernate-syscache-with-non-web-application – cbp Jul 11 '14 at 06:26

1 Answers1

1

No it doesn't, Syscache is an abstraction over asp.net cache. You have to use a different cache for the service.

EDIT: I remember this blog post: http://www.hanselman.com/blog/UsingTheASPNETCacheOutsideOfASPNET.aspx They say it should be usable outside a web-environment. It's just not recommended because microsoft maintains it to be usable in a web environment. That means that you can use it now, but you might have trouble when .Net 4 (or 5, 6, 7, ...) is released.

Paco
  • 8,335
  • 3
  • 30
  • 41
  • 1
    Thanks. But assuming this is the case, shouldn't NHProfiler show a lot of cache misses? It doesn't show any hits or misses. – Khash Apr 03 '10 at 19:57
  • See edit why NHProfiler probably doesn't show misses. (I'm not completely sure) – Paco Apr 03 '10 at 22:00