Memcache and Smarty

Brian P Brooks Brian.Brooks at Colorado.EDU
Mon Sep 10 18:57:44 UTC 2007


I highly suggest creating separate templates for static parts of your  
page, i.e. headers, footers, etc...  Have Smarty cache those  
templates, and in your 'more dynamic' templates, disable smarty  
caching and cache heavy with Memcached.  It would probably be much  
faster to use memcached than have Smarty recompile it's caches all  
the time on your more dynamic templates - which sounds worthless...   
plus, it's a cache to disk...

I would love to be able to do a benchmark on this method; disable  
Smarty caching and use memcached, vs pure Smarty caching.

Or one could always use the Memcached plugin for Smarty :) It doesn't  
seem to be that popular though.

Brian Brooks
brian.brooks at colorado.edu
Mobile: 303.319.8663



On Sep 10, 2007, at 2:06 AM, Marcus Bointon wrote:

> On 10 Sep 2007, at 08:50, Rob Sharp wrote:
>
>> Smarty will compile each of these sections individually and then  
>> cache the page as a whole. There's not currently (AFAIK) template- 
>> level caching in Smarty, but one of my co-workers has a working  
>> implementation that we're testing.
>
> That's not true. Smarty caches whole templates, but one template  
> can be included in another, hence you can get selective caching of  
> page elements. Read the docs carefully as it's quite fiddly: http:// 
> smarty.php.net/manual/en/caching.php
> In particular notice {insert}, and also that plugins can choose  
> whether their output is cached.
>
> Marcus
> -- 
> Marcus Bointon
> Synchromedia Limited: Creators of http://www.smartmessages.net/
> UK resellers of info at hand CRM solutions
> marcus at synchromedia.co.uk | http://www.synchromedia.co.uk/
>
>

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


More information about the memcached mailing list