TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,230
  • Total Topics: 21,353
  • Online today: 446
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 375
  • Total: 376
  • @rjen

Again RSS : Why it increases page creation time to 4x ?

Started by Ricky., March 15, 2008, 11:26:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ricky.

Hi..

I once had problem with RSS feed using TP about server load , I discussed here :
http://www.tinyportal.net/index.php?topic=20698.0

It was solved as instead of using RSS I then used code given there.

Well, I need to display RSS from other SMF forum to my this SMF forum, both are on same server. Problem is that, whenver I enable RSS block, page creation time goes high to 4x of original time.


I thought that reading RSS of whole forum is problem as both are on same,so what I did, I used feedburner, feedburner actually caches ur RSS and refresh it every 30 minute.. means no load in server for checking RSS everytime when it is accessed.

But result is not so good, still page creation time is 4x-5x but now it varies between 2x-5x.

I am using following code for puling RSS :
// TP RSS Article Script

// TP Function
$context['TPortal']['rss_notitles']= true;

// Create An XML Parser
$xml_parser = xml_parser_create();

// Set The Functions To Handle Opening & Closing Tags
xml_set_element_handler($xml_parser, "startElement", "endElement");

// Set The Function To Handle Blocks Of Character Data
xml_set_character_data_handler($xml_parser, "characterData");

// Open The XML File
$fp = fopen("http://feeds.feedburner.com/eti-yoindia","r")
or die("Error reading RSS data.");

// Read The XML File 4KB At A Time
while ($data = fread($fp, 4096))

// Parse Each 4KB Chunk With The XML Parser
xml_parse($xml_parser, $data, feof($fp))

// Handle errors in parsing
or die(sprintf("XML Error: %s At Line %d", 
xml_error_string(xml_get_error_code($xml_parser)), 
xml_get_current_line_number($xml_parser)));

// Close XML File
fclose($fp);

// Free Up Memory Used By XML Parser
xml_parser_free($xml_parser);

I am using this to call pull RSS in a custom block.

Any light why it is delaying when feed is actually static ie. loaded from cache of feedburner ?

So, does this mean the code I am using for pulling rss is having some shortcoming ?


This website is proudly hosted on Crocweb Cloud Website Hosting.