Caching seems to be the new trend. But aside from all the marketing, it’s really a lot more than that. If you don’t have the money to buy those lovely Zend products, you might find yourself turning to the world of Open Source (again). And viola! You’ll be helped.
There are two ways to cache with PHP – as far as I know -, one is using PEAR’s Cache_lite class. There’s an article already about it on Devshed, but since someone already spoiled it and I am not too much of a pear-lover myself (I like wine-berries, oranges and stuff), I’ll talk about phpCache. So here we go.
So, at first we’ll start with the principals. What does this caching thing do? And why do I want it?
Caching is used in a million things. For example, there is your browser’s cache, which saves a website to your harddrive so next time, you go to this website, it’ll come up a lot more faster on your screen. Your ISP probably also offers caching through a proxy server. In this case, highly frequented websites are downloaded to the ISPs proxy server and delivered to you a lot faster than if you would go to the site directly. Thumbnails of larger images are a way of caching too.