I'm building a music application in Symfony 1.4 Doctrine 1.2. I'm using slots to customize the facebook api metatags in my layout header. For example, when I browse a song page, the showSuccess
for the song will have a slot like the one below, that populates the layout header meta tags with dynamic information depending on what song it is.
<?php slot('fb_metaproperty_title') ?>
<meta property="og:site_name" content="abc"/>
<meta property="og:title" content="<?php echo $songs['song_name'].' by '.$songs['full_name'] ?>"/>
<meta property="og:type" content="song" />
<meta property="og:description" content="This song is currently ranked <?php echo $songOverallRank?>th" />
<meta property="og:url" content="<?php echo $linktosongpage ?>"/>
<meta property="og:image" content="<?php echo $images[0]?>"/>
<?php end_slot() ?>
The problem is I have cache is turned on and the $songOverallRank
variable is cached in the slot so that rank value is out of date (as it changes often). The same $songOverallRank
variable is up to date in the code directly below (but outside of) the slot. Just the slot values are cached and out of date for some reason.
I checked symfony documentation on how to manually remove cache values and it seems pretty cumbersome.
Is there a simple configuration or way to just disable the cache for slots? Is there a solution to make sure the slot isn't cached and the variables are pulled exactly the same as the rest of the template (which has up to date values)?
I'm using sfMemcacheCache
for view_cache/results_cache
and APC for sfPatternRouting
cache if that helps.