[drupal-devel] Swiss army knife of RSS feeds - SQL Search patch
I've uploaded a very rudimentary patch to trip_search (aka SQL search) giving it the ability to generate a RSS feed based on the search. I'll let those with more drupal skills than I have take it further and bring it up to standards, but it's such a simple and easy patch (kudos to everyone who makes it easy to write drupal code) and gives such a great benefit (unlimited customizable RSS feeds of whatever content you want), I want to be sure it doesn't get lost and the right people see it to make those improvements. http://drupal.org/node/32212
Seth, et al. I hacked this into Drupal search once too. Just as a proof of concept. It got my server completely to its knees. Drupal search is amoungst the most heavy pages of Drupal. XML feeds are all pulled in at once mostly on the hour. My stats show my feeds are accessed most of all my pages. In order to do this right some ground-level changes need to get into drupal (they are options, just random ideas, in fact): * For a feed we must load everything trough a bootstrap. No need to render all sorts of blocks, do user checks etc etc, only to generate a feed. * For a feed we could decide to do Really Agressive Caching: let only one module (be able to) clear the feeds cache. Maybe even time-based. Maybe even save a feed as a real file: feed.xml * Possibly pull the feed system completely out of the common system, into a feed.php (as opposed to index.php) Because your feature is not only very nice, i beleive it should be in Drupal core. Drupal, the community, (partly) grew big trough its feed support, we should not leave our support as it is, but continuously develop this. Feeds are really hitting big masses lately. Ber On Monday 26 September 2005 04:56, Seth Cohn wrote:
I've uploaded a very rudimentary patch to trip_search (aka SQL search) giving it the ability to generate a RSS feed based on the search. I'll let those with more drupal skills than I have take it further and bring it up to standards, but it's such a simple and easy patch (kudos to everyone who makes it easy to write drupal code) and gives such a great benefit (unlimited customizable RSS feeds of whatever content you want), I want to be sure it doesn't get lost and the right people see it to make those improvements.
I hacked this into Drupal search once too. Just as a proof of concept. It got my server completely to its knees.
Yeah, I have no doubt that with heavy traffic, the # of SQL queries for this would be too much. SQL search is already heavier than using the normal search module, and the flexibility of allowing just about any combo of nodetype, taxonomy, user and keyword is sure to come at a price tag.
* For a feed we must load everything trough a bootstrap. No need to render all sorts of blocks, do user checks etc etc, only to generate a feed.
User checks should be included though to allow the possibility of passworded RSS feeds, which some people want, and to not expose items which are access controlled otherwise. That's one thing this patch doesn't really deal with.... (It'll have anonymous access most times... unless you have a cookie or phpsessionid)
* For a feed we could decide to do Really Agressive Caching: let only one module (be able to) clear the feeds cache. Maybe even time-based. Maybe even save a feed as a real file: feed.xml
Caching by just saving 'search as feed' might be a good way to implement this very cheaply now.... If a previous xml file exists for 'search ABC', and file is older than X minutes, do the search again and resave it, otherwise skip the expensive SQL search and just return the file contents. Popular feeds would be usually be file cached and incur no SQL lookups more than X minutes apart. Unpopular feeds would be a bit slower since the initial file lookup and save would be added to the already needed SQL search time.
Because your feature is not only very nice, i beleive it should be in Drupal core. Drupal, the community, (partly) grew big trough its feed support, we should not leave our support as it is, but continuously develop this. Feeds are really hitting big masses lately.
I was surprised nobody had done this patch before.... but then I thought Drupal's "/feed" for rss was already implemented in lots of modules (and was surprised how many modules it doesn't work for...) Eventfinder (eventfinder/search_events) is another good example that could use a good RSS feed and doesn't have one... "I want a feed of events within 50 miles of me" Unless someone adds a location patch to SQL search....
participants (2)
-
Bèr Kessels -
Seth Cohn