Posted By: staceyw | Aug 21st @ 2:28 PM
page 1 of 1
Comments: 2 | Views: 721
staceyw
staceyw
Before C# there was darkness...

Wondering what is the difference between using a static object yourself and using Cache object in an ASP app.  I have an Astoria rest service (ADO Data Service) where I want to store some static data lists and perform some work on that data in another thread after a Post for example.  I remember that asp apps can be recycled at any time so I not sure what kind of pattern to use here.  Any good blog posts or papers on cache/static data/asp appdomains/etc.  TIA

blowdart
blowdart
Peek-a-boo
When the app gets recycled the asp.net cache goes with it because it's part of the process; so there's no real difference from your point of view.

If you don't want the data to get dumped when memory gets tight I'd say use a static class; you don't need the full facilities of the cache.
Use statics if they're not too big and the data won't change.  Cache otherwise.
page 1 of 1
Comments: 2 | Views: 721