I am facing a very big problem in magento regarding cache, I am using 1.7 version of magento and I have a file where I am checking page title but result is correct only on first hit.And after that the old cache result. How do I resolve it?
1 Answer
use this code
$this->getLayout()->getBlock('head')->getTitle();
you can use this code in your phtml file
-
Still it is returning old value?Vivek Khandelwal– Vivek Khandelwal2015-10-20 09:46:37 +00:00Commented Oct 20, 2015 at 9:46
-
yes it is returning same valueUser3515241– User35152412015-10-20 09:47:11 +00:00Commented Oct 20, 2015 at 9:47
-
Actually header and footers are set via cache in magento Try disabling the cache then it will respond you the correct titleVivek Khandelwal– Vivek Khandelwal2015-10-20 09:48:29 +00:00Commented Oct 20, 2015 at 9:48
-
if i disable the cache then it will effect on my site speed.. i think you know this..User3515241– User35152412015-10-20 09:53:59 +00:00Commented Oct 20, 2015 at 9:53
-
Then you have to disable cache for a particular block here is a link how you can do that magikcommerce.com/blog/… Without disabling it wont be possibleVivek Khandelwal– Vivek Khandelwal2015-10-20 10:09:06 +00:00Commented Oct 20, 2015 at 10:09