Views pages with with Drupal's built-in page cache, but RSS feeds of those view don't. They are regenerated from scratch on each hit. This is a pretty serious performance hit for sites with lots of subscribers.

The problem is that theme_views_rss_feed exit()'s without calling page_set_cache() or drupal_page_footer(), which allows a page to be cached. I've attached a patch that fixes this by adding a call to . In my limited testing, it works fine and cached rss feeds are returned over 10x faster. Since the same cache invalidation routines work fine for a normal View, I can't imagine that they'd cause a problem for an RSS feed of the same data.

If the page cache is not enabled in settings/performance than this patch effectively does nothing.

This patch should also ultimately reduce bandwidth costs, since Drupal will now be able to return more accurace Cache-Control and Last-Modified headers.

CommentFileSizeAuthor
views_rss_allow_page_cache.patch419 byteseli

Comments

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

good catch. should be ported to Views2 if it does the same exit.

merlinofchaos’s picture

Looks good to me.

Views 2 has a much better flow and doesn't exit for feeds.

esmerel’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

At this time, only security fixes will be made to the 5.x version of Views.