"Basic Cache" prevents RSS feed block from updating
Permalink
Hey guys, I'm running into a problem where the RSS feed on my site doesn't update (after any amount of time, weeks can go by without it changing). Full Page Caching is disabled on my site. Pressing the "Clear Cache" is a way to manually update the feed.
Any ideas on how to get this to work properly without disabling cache altogether? Is there a way to make the Basic Cache to expire every day or something like that?
Any ideas on how to get this to work properly without disabling cache altogether? Is there a way to make the Basic Cache to expire every day or something like that?
EDIT: In hindsight, after seeing $TorstenKelsch's suggestion I would simply set these four values to false as opposed to removing them as I had suggested below.
You can edit the block itself if you are so inclined to prevent it from caching or set it to expire after an amount of time.
In the file
You will see near the top this
If you remove this the block will no longer cache and will reload everytime. Although, from what I understand the SimplePie library used by that block will cache the results on it's own for 60 minutes.
I haven't tested this for sure but you should be able to add a lifetime to the cache for the block to line up with this 60 minutes like this.
EDIT: Oops typo on $btCacheBlockOutputLifetime
You can edit the block itself if you are so inclined to prevent it from caching or set it to expire after an amount of time.
In the file
/concrete/blocks/rss_displayer/controller.php
You will see near the top this
protected $btCacheBlockRecord = true; protected $btCacheBlockOutput = true; protected $btCacheBlockOutputOnPost = true; protected $btCacheBlockOutputForRegisteredUsers = true;
If you remove this the block will no longer cache and will reload everytime. Although, from what I understand the SimplePie library used by that block will cache the results on it's own for 60 minutes.
I haven't tested this for sure but you should be able to add a lifetime to the cache for the block to line up with this 60 minutes like this.
protected $btCacheBlockRecord = true; protected $btCacheBlockOutput = true; protected $btCacheBlockOutputOnPost = true; protected $btCacheBlockOutputForRegisteredUsers = true; protected $btCacheBlockOutputLifetime = 60*60;
EDIT: Oops typo on $btCacheBlockOutputLifetime
Thank you, mkly, I have followed your instructions (after copying the block from /concrete/blocks to /blocks of course). A caching of 60 minutes is all right, so I think I’ll leave the SimplePie stuff untouched. But a cache for days or even weeks was inacceptable.
I will watch the RSS Displayer for a few days and then let you know if the problem is fixed. Thanks again for your quick help.
I will watch the RSS Displayer for a few days and then let you know if the problem is fixed. Thanks again for your quick help.
Hi. I have the same problem.
Removing the protected $btCacheBlockOutputLifetime = 60*60; line results in an error when loading the page and removing the block altogether removes the RSS feed content !!
Removing the protected $btCacheBlockOutputLifetime = 60*60; line results in an error when loading the page and removing the block altogether removes the RSS feed content !!
Forgot to mention that I did not remove the lines, but set true to false. And I did not add the line with the lifetime. This way it seems to work all right.
Thanks. That's cured the problem of the disappearing feed. I just need to wait until tomorrow before I find out if the feed is still up-to-date.
Pete
Pete
I only meant for you to remove the 4 lines above. That said @TostenKelsch suggestions to simply set those to false is probably much easier to understand and I would recommend doing it as he wrote.
another option if all of the above don't work is:
$feed->enable_cache(false);
$feed->enable_cache(false);
Do you mean within function view()?
But it seems that it does not work in all cases. I have troubles with this, too.