regarding what to cache???

Chris Goffinet goffinet at yahoo-inc.com
Tue Sep 4 06:24:31 UTC 2007


Its best practice usually to catch objects in a way that is not SQL  
query statement dependent. Since if you used the query statement as  
key, you could end up caching duplicate data since SQL statements can  
change often depending on data grabbed.

I haven't used Smarty in awhile, but I believe its possible to save a  
smarty template object as a string which you can cache. And if not,  
you can always use the:

ob_* (ob_start) functions. Not my cup of tea for doing that though :)  
Has to be a better way.



Chris Goffinet
goffinet at yahoo-inc.com



On Sep 3, 2007, at 11:18 PM, K J wrote:

> It's also probably not very desirable.  I'm guessing that you're  
> doing something with that result set -- transforming it into some  
> object or representation suitable for display.  That's the thing you  
> want to cache.
>
> Are you saying that it's better to cache the output, as opposed to  
> SQL queries?
>
> For those of you familiar with PHP, what if the output is being  
> handled by Smarty? This means I can't really handle the output  
> directly.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070903/aea037c9/attachment.html


More information about the memcached mailing list