RSS feed cache not getting reset on new content

hadsie - October 6, 2009 - 13:00
Project:Boost
Version:6.x-1.x-dev
Component:Caching logic
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

When I add new content to my site (promoted to front page) everything seems to reload fine with the exception of the anonymous RSS feed.

I can view the new content on my site as anonymous or authenticated, and the RSS feed is complete for authenticated users. But when I try and view the RSS feed as an anonymous user the most recent post will be missing. Upon clearing the sites cache the RSS feed for anonymous begins working.

Is there something I can do to configure the RSS cache for anon to be cleared after new content is added?

Thanks!
Scott

#1

mikeytown2 - October 6, 2009 - 17:14
Version:6.x-1.03» 6.x-1.x-dev
Category:support request» bug report

<?php
/**
* Expires the static file cache for a given page, or multiple pages
* matching a wildcard.
*
* @param $path
*   Current URL
* @param $wildcard
*   If true get all chached files that start with this path.
*
* TODO: Replace glob() with a database operation.
*/
function boost_cache_expire($path, $wildcard = FALSE) {
 
// Sanity check
 
if (boost_file_path($path, FALSE) === FALSE) {
    return
FALSE;
  }

 
// Get list of related files
 
$tempA = glob(boost_file_path($path, FALSE, NULL) . (($wildcard) ? '*' : '') . BOOST_FILE_EXTENSION, GLOB_NOSORT);
 
$tempB = glob(boost_file_path($path, FALSE, NULL) . (($wildcard) ? '*' : '') . BOOST_XML_EXTENSION, GLOB_NOSORT);
  if (!empty(
$tempA) && !empty($tempB)) {
   
$filenames = array_filter(array_merge($tempA, $tempB));
  }
  elseif (!empty(
$tempA)) {
   
$filenames = $tempA;
  }
  elseif (!empty(
$tempB)) {
   
$filenames = $tempB;
  }
  else {
    return
FALSE;
  }
  if (empty(
$filenames)) {
    return
FALSE;
  }

 
// Flush expired files
 
foreach ($filenames as $filename) {
   
boost_cache_kill($filename);
  }
  return
TRUE;
}
?>

Looks like I need to replace glob with a database operation.

In short the front page rss feed is called feed_.xml in the boost cache; the html is called _.html. Doing a file search for the front page doesn't work too well in this case.

#2

mikeytown2 - October 6, 2009 - 22:17

boost_cache_expire_derivative() will have to be redone; boost_cache_expire() might be killed. boost_cache_expire_derivative() will directly call boost_cache_kill().

When boost_cache_expire_derivative() is called will find aliases & redirects so it can find a matching filename in the database. Once a match is found, it then gets the page_callback, page_arguments and page_id; searching the database that match all 3. These are the files in the cache that need to be expired. Should cover html, xml, and ajax & url variables.

#3

mikeytown2 - October 7, 2009 - 02:18
Status:active» needs review

This patch is for the latest dev. It can't be done very easily without the latest changes that have gone in.

AttachmentSize
boost-597156.patch 6.81 KB

#4

mikeytown2 - October 7, 2009 - 19:11
Status:needs review» fixed

committed

#5

hadsie - October 13, 2009 - 03:33

Thanks! Just updated to the .11 version, I'll report back if I have any problems.

#6

hadsie - October 14, 2009 - 03:12

After updating it still seems like the issue is there. Should I be using the dev version to resolve this?

#7

mikeytown2 - October 14, 2009 - 03:13
Status:fixed» active

No, I'll have to write in a special front page handler. What's the URL of your front page feed?

#8

mikeytown2 - October 14, 2009 - 05:31

it's /rss.xml correct?
Only holds content promoted to the front page right?

#9

mikeytown2 - October 14, 2009 - 08:25
Status:active» needs review

fixed some bugs in here as well.

AttachmentSize
boost-597156.patch 7.63 KB

#10

mikeytown2 - October 14, 2009 - 08:54

more bug fixing...

AttachmentSize
boost-597156.1.patch 8.83 KB

#11

mikeytown2 - October 14, 2009 - 08:55
Status:needs review» fixed

committed

#12

hadsie - October 15, 2009 - 02:13

that's right, it's the promoted to front page stuff. i'll try out this fix shortly, thanks so much!

#13

mikeytown2 - October 15, 2009 - 02:14

grab 6.x-1.12 ;)

#14

System Message - October 29, 2009 - 02:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.