I am using Symfony 1.3.2 and I have a page that uses a partial from another module.
I have two modules: ‘foo’ and ‘foobar’. In module ‘foo’, I have an ‘index’ action, which uses a partial from the ‘foobar’ module.
so foo/indexSuccess.php looks something like this:
<?php
<div id = 'container'>
<div id='part1'>Some data here</div>
<div id='part2'><?php include_partial('foobar/foobar_partial', $partial_params); ?></div>
</div>
?>
I want to cache ‘part2’ of my foo/indexSuccess.php page, because it is very expensive (slow). I want the cache to have a lifetime of about 10 minutes.
In apps/frontend/modules/foo/config/cache.yml
I need to know how to cache ‘part2’ of the page (i.e. the [very expensive] partial part of the page. can anyone tell me what entries are required in the cache.yml file?
If you want to cache the partial named ‘part2’ of the ‘foobar’ module, you need to add these lines to the file apps/frontend/modules/foobar/config/cache.yml
When you then call the partial from your index action in foo, a cached version (if available) will be shown:
If you want to cache a different version of the partial for each template that calls it, you should edit the cache.yml file like this: