Have you tried to cache only partials/fragments ?

If the cache.yml doesn't fill your needs, you can create more specific
caching in your partials with cache() and cache_save() methods.

Example :

<?php if (!cache('huge_process_of_the_death'.md5
<http://www.php.net/md5>($user->getEmail()), 86400)): ?>
  <?php foreach ($stuff as $item): ?>
    // Your amazingly huge iteration processes here
  <?php endforeach; ?>
  <?php cache_save() ?>
<?php endif; ?>


Alexandre

2009/10/19 SA <sarunas.atkociu...@gmail.com>

>
> Hello,
> we are developing a news website which mostly consists of constantly
> changing, but fully cacheable content, the only dynamic parts are ads
> which have to be selected randomly and user panel.
>
> We couldn't cache the pages with layout and had to include these
> components in the layout. The layout includes other components and
> actions that are cached in memcached. Profiling shows that even if the
> component is cached its a pretty costly operation to include it when
> you have many.
>
> This gives an idea of caching an action with layout and replacing
> dynamic parts of the page in a filter. Dynamic parts are marked by
> markers such as <!-- include_user_panel --> or <!
> include_ad_slot:main_slot -->. We tried this strategy and overhead
> added by this filters preg_match and replace seems to be minor -
> site's performance increased by 50%. I can't see any drawback in this
> now and I don't feel comfortable with it. :)
>
> What do you think of this strategy? Are we reinventing the wheel? Can
> we achieve this in a more 'standard' way?
>
> Please comment. Thanks.
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@gmail.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to