Currently, views_rss.module has a hard exit at the end of its theme function. This prevents drupal's cache mechanism from caching any view-generated feeds, which can have serious performance implications: every time a view feed is hit, it's as if a logged-in user requested the page!

This patch solves this by removing the hard exit, and doing a bit of output checking around returns in theme_views_view () and views_build_view().

I'm not super-proud of the fix in theme_views_view, which basically tracks the output of the specific theme function (e.g. the RSS function, which is returning nothing) as a separate variable, and then checks that at the end. This could be done cleaner -- e.g. working like the change in views_build_view -- but that would require re-working the way the function builds up the $output.

Anyway, submitted for your consideration...

Comments

sami_k’s picture

+1 This is definitely needed for views_rss!

populist’s picture

StatusFileSize
new2.57 KB

Very helpful for improving RSS/Views performance. Slight modification to your patch to pass output text to correct variable:
Change:
+ $views_output .= views_theme('views_view', $view, $type, $items, $info['level'], $args)
With:
+ $output .= views_theme('views_view', $view, $type, $items, $info['level'], $args);

joshk’s picture

Thanks for the catch. I must have made that patch vs. an interum copy before I realized I didn't need to use a separate $views_output var in views_build_view().

sirkitree’s picture

+1

moshe weitzman’s picture

Category: feature » bug
Priority: Normal » Critical
sun’s picture

sun’s picture

Status: Needs review » Closed (duplicate)
suganyaM’s picture

I did tried this patch. But its not working. can any one help pls

suganyaM’s picture

Issue tags: +view, +Rss Cache, +Views Empty text
StatusFileSize
new2.76 KB

Great Job.

The patch works perfects for me. The previous post was by my mistake.

A white blank page is shown if there no content from output. The above patches discards the Empty text content that is provided in the view. I have included a check to validate the Empty text content. If there is no Empty text, a white page is displayed.