How to keep certain blocks from being cached

#1
I have a facebook login and whenever I enable it my site just loads and loads then returns a 500 error. My log file says I ran out of memory.

So I've been trying to somehow exclude that block from being cached.

I added the name of the block to User-Defined Cache Rules under Customized Block Names for "toplinks" Tag. That didn't work so I added it to the config.xml like this:

<toplinks>
<access>private</access>
<blocks>top.links</blocks>
<purge_tags>cart, wishlist, fblogin</purge_tags>
<!-- This is a composite grouping. The purge events for the blocks in this grouping are
a combination of existing purge event sets from other groupings. By using purge_tags
to reference these other groupings, you do not need to redefine these purge events. -->
</toplinks>


Here is the XML file for the Facebook login:

<?xml version="1.0"?>
<layout version="0.1.0">
<customer_logged_out>
<reference name="top.links">
<block type="fblogin/fblogin" name="fblogin">
<action method="setTemplate">
<template>fblogin/fblogin.phtml</template>
</action>
<block type="fblogin/fblogin" name="fblogin" template="fblogin/fblogin.phtml" />
</block>
<action method="addLinkBlock">
<blockName>fblogin</blockName>
</action>
</reference>
</customer_logged_out>

<customer_logged_in>
<reference name="top.links">
<block type="fblogin/fblogin" name="fblogin">
<action method="setTemplate">
<template>fblogin/fblogout.phtml</template>
</action>
<block type="fblogin/fblogin" name="fblogin" template="fblogin/fblogout.phtml" />
</block>
<action method="addLinkBlock">
<blockName>fblogin</blockName>
</action>
</reference>
</customer_logged_in>

<customer_account_login translate="label">
<reference name="content">
<block type="fblogin/fblogin" name="fblogin" template="fblogin/fblogin.phtml" />
</reference>
</customer_account_login>

<fblogin_index_index>
<reference name="content">
<block type="fblogin/fblogin" name="bt_fblogin" template="fblogin/bt_fblogin.phtml" />
</reference>
</fblogin_index_index>
</layout>

How can I keep this block from being cached?

Thank you
 

Pong

Administrator
Staff member
#2
Just want to clarify: Which application do you use? Magento 1.9? You want to define a facebook login block to the excluded from LiteMage cache, right?

also
My log file says I ran out of memory.
Did you try to fix the memory limit in php.ini?
 
#3
I used Magento ver. 1.9.2.4 mostly. I have php 7. Memory limit is 512 I've been watching my usage very close because I noticed when the LiteMage Cache Warm-up starts it uses a lot of memory. So I set it to only run at 3:00am. But lite Mage is working very good and really makes my site fast, when I'm not flushing the cache.

Yes, I would like to exclude facebook login from being cached.

Thanks
 

Lauren

LiteSpeed Staff
Staff member
#4
Joseph,

First, you should not modify config.xml to add in purge_tags, it's a block name, not a tag.
From your layout xml, looks like that entry is within top.links. This should work by default, no need to change anything. Obviously, it's not working properly, that's a bug.
Do you have a test environment? I can give you a prebuild of LiteMage 1.1 and you can give a try.

Lauren
 
Top