News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Vito Chin's Blog:
Session-based object instantiation with memcached
March 09, 2009 @ 12:01:05

In this recent post to his blog Vito looks at something that could say you and your application some hassle (and from some higher memory usage issues down the line) - memcaching objects as their instantiated.

At runtime, a script sets up everything that it requires, allocating memory for variables and objects and all these gets torn down upon end of execution. There is no persistency beyond the notion of a session. [...] So, there will be lots of object construction and destruction going on while the user of a PHP web app goes about her business dealing with the same app. Here's where object caching with memcached helps.

He suggests using memcache to cache and retrieve objects as they're needed instead of creating multiples over and over again. It almost functions as a Singleton, checking to see if there's already an object created before sending out a new one.

0 comments voice your opinion now!
memcached object instantiate session framework cache singleton


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Image Scraping with Symfony's DomCrawler

PHPClasses.org: Book Review - PHP 5 CMS Framework Development - 2nd edition (Packt)

International PHP Magazine: Poll Question: Which is the Most Common Design Pattern?

Matthew Weier O'Phinney's Blog: Symfony Live 2010 (A message of Interoperability)

Jim Plush\'s Blog: The End of alert() - MyBic 0.6.2 AJAX Released


Community Events





Don't see your event here?
Let us know!


threedevsandamaybe introduction podcast community opinion release framework unittest list language refactor testing interview developer laravel code configure symfony2 install series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework