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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Version: 6.x-1.03 » 6.x-1.x-dev
Category: support » bug
/**
 * 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.

mikeytown2’s picture

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.

mikeytown2’s picture

Status: Active » Needs review
FileSize
6.81 KB

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

mikeytown2’s picture

Status: Needs review » Fixed

committed

hadsie’s picture

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

hadsie’s picture

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

mikeytown2’s picture

Status: Fixed » Active

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

mikeytown2’s picture

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

mikeytown2’s picture

Status: Active » Needs review
FileSize
7.63 KB

fixed some bugs in here as well.

mikeytown2’s picture

FileSize
8.83 KB

more bug fixing...

mikeytown2’s picture

Status: Needs review » Fixed

committed

hadsie’s picture

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

mikeytown2’s picture

grab 6.x-1.12 ;)

Status: Fixed » Closed (fixed)

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