RSS Feed and Cache files

Permalink
So I'm having a lingering problem with my 5.8 install -- I cannot get C5 to automatically update the RSS feed on the front page.

The problem is the cache, because if I clear the cache through Systems & Settings, the RSS feed updates.

So, I turned off all caching settings in Systems & Settings. Still not updating. Checked the concrete_overrides.php, everything is set to false. Checked my /application/config/concrete.php override file, no cache setting in this file.

Checked and cleared the Page level cache under Page Settings -> Cache. This doesn't update the RSS block.

Next I created an /application/blocks/rss_displayer directory and copied the controller.php into this directory. Set every cache protected variable to false. Also went through and set every "cache in seconds" to 30 mins. Doesn't update within the 30 mins.

Looking in the cache directory, I find a php file within the structure. The following is the file header:

/* Cachekey: cache/stash_default/zend/zend_feed_reader_05c872a89306302de84502fad8059dc7/ */
/* Type: array */
/* Expiration: 2017-07-18T23:08:50-04:00 */


Since today is 7/14/2017, it looks like Zend is still setting a five day long cache.

So, how do I either reduce or turn off the Zend cache settings? Thanks!

Doki
View Replies:
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi Doki,

Have you tested this using the latest 8.2 branch on GitHub or RC2?
Doki replied on at Permalink Reply
Doki
Just pulled the 8.2 branch today. Same issue. Using 8.2 on 7/18, file /application/files/cache/0fea6a13c52b4d47/25368f24b045ca84/38a865804f8fdcb6/57cd99682e939275/8f3a01e2e3b200aa/f980d8ea6abd2ae6/0f2f4654703e9624/5c463d3bd8f89dc7.php:

<?php
/* Cachekey: cache/stash_default/zend/zend_feed_reader_05c872a89306302de84502fad8059dc7/ */
/* Type: array */
/* Expiration: 2017-07-23T11:00:50-04:00 */


So, newest version not working either (again, all cache settings turned off).
Doki replied on at Permalink Reply
Doki
So my current workaround is a cronjob that deletes the cache every two hours. Simple but overkill -- like fixing a crack in the wall of a house with a bulldozer. Works for now, but I still hoping for a more elegant solution.

I'm loathe to go into the Zend code and manipulate timers at the Zend level because I'm not certain the effects of doing this on the other C5 systems.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@Doki

What is the RSS feed address?
Doki replied on at Permalink Reply
Doki
Sorry for the delay in reply. The feed is:

http://blog.library.villanova.edu/feed/?cat=15...
jlgrall replied on at Permalink Reply
Same problem here. Using concrete5 8.2.1 with PHP 7.0

How to reproduce:
- edit one of your pages of your concrete5 website
- add a new block of type: RSS Displayer
- set the feed URL to:http://lorem-rss.herokuapp.com/feed...
- click "Add" to add the block to your page (you don't need to publish the page, just having the rss feed displayed in edit mode is enough)
- go in your directory: /application/files/cache/0fea6a13c52b4d47/
- search for files containing the string "Lorem ipsum feed" (or "zend_feed_reader" for all cached feeds)
- see the expiration date, it is more than 4 days in the future

The cache lifetime should be 30 minutes: see "$rssFeedCacheLifetime = 1800;" in /concrete/blocks/rss_displayer/controller.php
But here it is more than 4 days (I get 4 days 19 hours 27 minutes).
Also, I don't know if it is related, but in the cached file, the expiration date and the expiration timestamp don't match. The expiration timestamp is 20 minutes before the expiration date.

Edit: a better workaround would be to not delete the whole cache, but only the cached RSS feeds with a cron job like this:

find 'public_html/application/files/cache/0fea6a13c52b4d47/25368f24b045ca84/38a865804f8fdcb6/57cd99682e939275/8f3a01e2e3b200aa/f980d8ea6abd2ae6' -exec grep -qF 'Cachekey: cache/stash_default/zend/zend_feed_reader_' '{}' \; -print -delete

Note: yes, apparently the RSS feeds are always cached in that cryptic directory, so we can reduce the research to a few files instead of scanning thousands of files.