OS X uses a multitude of cache files--as an example, my user's Library/Caches folder contains 164 top-level items, most of which are folders containing more folders. In total, there's presently 1.18GB of cached data, just for my user. Wow.
Most of the time, this is a Good Thing, as it makes the system more responsive, as it's quicker to retrieve something from cache than to calculate or redownload it. However, it can also be troublesome at times. Like this morning, in my case.
I fired up Mail, and despite the fact that it was running perfectly last night, it was glacial. Folders took multiple minutes to open. Moving a message was a 15 minute process, if it worked at all. Even worse, though, was that when Mail was having its fits, the Finder was completely unresponsive. I could click on some folders, but others would bring the Finder to the land of permanent spinning rainbows. Trying to mount a disk image resulted in more spinning rainbows.
So I restarted, and tried again--it had been quite a while since the last restart. But I had the exact same symptoms. Unresponsive Mail and flakey Finder. I spent a few minutes trying to figure out if I'd changed anything or not, even though I was positive I hadn't touched the system while sleeping :).
Then, after another restart and repeat of issues, I thought I'd try deleting Mail's cache folders. Inside my user's Library/Caches folder, I opened the Mail folder and deleted everything, then emptied the trash. Launched Mail again, and...voila, it was perfect! Speedy as its ever been, and the Finder didn't have fits while Mail was running. Everything was basically back to normal--all because I deleted a series of temporary files that are supposed to do nothing more than make data access quicker. Go figure!
This is the first real cache trouble I've had on OS X, but it is a relatively common source of issues for others. Since cache folders exist in many spots (your user, the top-level Library folder, and the System folder), you might want to look into one of the cache cleaners, such as Cache Out X or Tiger Cache Cleaner (among many others), to make the job simpler.
I think I may add a general cache emptying routine to my crontab, just to make sure it happens somewhat regularly, given how much trouble this one incident caused.