By imgiseverything
via imgiseverything.co.uk
Published: May 24 2008 / 17:27
This week, my work for our top secret web app, has mainly revolved around caching. This is work I really enjoy. I can sense the user experience of future customers improving each time I create a useful cache of information that speeds up a page’s load time.
In 4 steps I'll demonstrate how to easily cache a PHP object for improved performance.
Comments
amphi replied ago:
Wow. Even the thumbnail makes my eyes hurt. Worst color scheme ever.
Daron replied ago:
Looks to me like this guy has effectively reinvented Memcache with flat files. No idea why he bothered, unless his server has no RAM...
http://www.php.net/manual/en/intro.memcache.php
,
hal10001 replied ago:
I love it when developers throw out a module like memcache, and completely fail to see the benefit of at least trying to understand how to write your own caching mechanism. That just goes to show that most developers are cut-and-paste, fly-by-night programmers. Could he use memcache? Would it suit his needs as well as the needs of several others? Well, it sure might, but then you would really know absolutely nothing about object caching in PHP would you? Try suggesting an alternative approach altogether, other than a pre-built solution.
blizz.myopenid.com replied ago:
I custom built the system I use for my site. It uses a combination of file caching + memcache depending on how old the object being cached is and how frequently it is accessed. So this is a nice beginning towards that, but I would certainly take a look at memcache. If you need caching from multiple servers, try APC
imgiseverything replied ago:
Thanks for everyone's comments in this thread.
@Daron: You'll have to excuse my ignorance, I didn't know about Memcache. I'll be looking into it to see if it suits my needs though.
Voters For This Link (6)
Voters Against This Link (4)