I'm constantly hearing about person y had performance issue x which they solved through caching.
Or, how doing x,y,z in your programs code can hurt your caching ability.
Even in one of the latest podcasts, Jeff Atwood talks about how they cache certain values for speedy retrieval.
There seems to be some ambiguity in the terms "cache" and "caching" and it has led me to be confused about it's meaning in different cases. Whether you are referring to application or database caching, cpu, etc and what that means.
What is caching and what are the different types?
From context I can get a sense of it, to store an oft retrieved value into main memory and have quicklook up access to it. However, what is it really?
This word seems to be used in a lot of different contexts with slightly different meaning (cpu, database, application, etc) and I'm really looking to clear it up.
Is there a distinction between how caching works in your applications vs your database caching?
When someone says that they found a piece of code that would hurt caching and after they fixed it, it improved the speed of their app, what are they talking about?
Is the program's caching something that is done automatically? How do you allow values to be cached in your programs? I've often read users on this site say that they cached a value in their application, I sit here and wonder what they mean.
Also, what does it really mean when someone talks about database caching? Is this simply a feature they turn on in their database? Do you have to explicitly cache values or does the database pick which ones to cache for you?
How do I begin caching items myself to improve performance?
Can you give me some examples of how I can begin caching values in my applications? Or again, is this something that is already done, under the hood and I simply have to write my code in a particular way to allow "caching"?
What about database caching, how do I begin that? I've heard about things like memcache. Is this type of utility required to cache in databases?
I'm looking to get a good distinction between caching in applications vs databases, how they are used and how it is implemented in both cases.