tags:

views:

88

answers:

4

Where does cached data is stored in Asp.Net application (heap or ram)

A: 

Where do you think the heap is? It all ends up in RAM or the Pagefile :)

Was there something else specific to this question, access times etc?

Lloyd
A: 

Yes i wanted to know whether stack or heap.I wanted to know how caching is faster.

vinodacharyabva
Dude, when adding more information, you should not add anwers to your own question, you should either a) re-edit the question or b) add a comment directly addressing the answerer.Hope this helps.
Binary Worrier
+2  A: 

Well (and this is completely simplified)

Classes (i.e. Reference Types) are stored on the heap, with a pointer to that reference type stored on that stack.

Structs/Simple Types (i.e. Value Types) are stored directly on the stack.

But with regards caching, the idea is that the value you are storing is stored in Application Memory full stop.

The benefit would be that if you have some value that you regulary use, that's stored in the Database, then you could retrieve it once, place it in cache memory, and retrieve it directly from memory on each subsequent use, instead of having to go back to your Database (or FileSystem or other relatively slow-retrieval storage medium)

Eoin Campbell
If you're going down this road you might find something like MemCached (http://en.wikipedia.org/wiki/Memcached) useful as it's optimized for loading small cached data.
Lloyd
Memcached looks interesting. There are providers for it on CodePlex- http://www.codeplex.com/memcachedproviders. Microsoft also have their own version called Velocity- http://msdn.microsoft.com/en-us/data/cc655792.aspx.
RichardOD
+2  A: 

Eoin is absolutely correct! Caching only means storing the data from your secondary memory or hard disk (database, files, etc) into the primary memory or application memory. It speeds up the execution because reading from app mem is faster than reading from disks. So if say a file is stored in Cache, you can read it quicker than if it wasn't and you had to read it from disk.

For more details on caching in asp.net visit this link

General idea on cache memory can be found here

Rashmi Pandit