Zend Framework 101: Zend_Cache
At this stage you should have a reasonable understanding of how Zend_Cache works. It is simple but can be very powerful.
One of the most important things I can recommend is to clearly document all of your caching points. That is, know exactly where your cache is being read from, being written to, or being cleared. Know exactly how tags are structured and what impact clearing on them will have.
It's very easy to let a complex caching system get out of control and to have no idea exactly how it is operating. I recommend including logging on hits and misses and tracking the frequency of cache modifications.
To summarise, in this article we looked at how to implement a caching solution in your PHP web site using the Zend_Cache component of the Zend Framework.
I first introduced you to how caching works and how it can be leveraged to improve your web site's performance. Next I introduced you to Zend_Cache and its front and back-ends drivers.
Next I showed you how to cache the output of entire PHP scripts using the page front-end. I then showed you how to tag cache records, then clean the cache using tags. Finally, I described a real-world implementation of Zend_Cache and its tagging mechanism.
- http://framework.zend.com/manual/en/zend.cache.html - Zend Framework manual entry for Zend_Cache.
- Download a PDF version of this article
- Put your PHP knowledge to the test with our online and iPad/iPhone quizzes
- View or post comments for this article
- Browse similar articles by tag: PHP, Zend Framework, Zend_Cache
- Read related articles: