Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6643261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:01:49+00:00 2026-05-26T00:01:49+00:00

I have pulled 7 RSS feed and parse in our website. But the parse

  • 0

I have pulled 7 RSS feed and parse in our website. But the parse time is very slow, what is the best way to parse RSS feed in PHP.

Also is there a way to GZip for faster parse time?

I use this GZip in my .htaccess file but no difference

Here’s the GZip script in my .htaccess file

# compress text, html, javascript, css, xml: AddOutputFilterByType
DEFLATE text/plain text/html text/xml text/css application/xml
application/xhtml+xml application/rss+xml application/javascript
application/x-javascript

Here’s my PHP code to parse RSS feeds

<?php
function getFeed($feed_url){
    $content = file_get_contents($feed_url);
    $x = new SimpleXMLElement($content);

    for ($i=0; $i<=4; $i++){
        $entry = $x->channel->item[$i];

            // if promotion price is set, then use the promotion price instead of Normal Price
            $normal = $entry->NormalPrice;
            $promo  = $entry->PromotionPrice;

            // Get the links and titles
            $image = $entry->Image->Url;
            $link = $entry->link;
            $title = $entry->title;

            if((isset($promo)) && ($promo > 0)){
                $price = 'R '.number_format(trim($promo), 2);
            }else if($normal > 0 && $promo == 0){
                $price = 'R '.number_format(trim($normal), 2);
            }else if((empty($normal) && empty($promo)) || (($normal == 0) && ($promo == 0))){
                $price = 'Out Of Stock';
            }


                echo '<div class="rssImages">';
                echo '<div class="imageCover">';
                echo '<a href="'.$link.'"><img src="'.$image.'" /></a><br /><br />';
                echo '</div>';
                echo '<div class="rssCntImg">';
                echo '<a href="'.$link.'" id="rsslinks">'.$title.'</a> <br />';
                echo '</div>';
                echo '<strong>'.$price."</strong>";
                echo '<label class="cleared"></label>';
                echo '</div>';          
    }
}
?>

any help/suggestion will be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:01:50+00:00Added an answer on May 26, 2026 at 12:01 am

    It seems you are parsing your feeds online, on each and every user request.
    It always would be slow. It is network, you know.

    The only sensible way of reading RSS feeds is asynchronous one. One script to parse them regularily and update the local database and another to show entries from the local database.

    And, you know, gzipping output has very little to do with parsing inbound data. Go figure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML structure that is being pulled from an RSS feed, and
I have an RSS feed being pulled through XSLT on an .xsl file. I
I have data pulled from a database and stored in Stata .dta files. But
I have several strings that have been pulled using cURL from another website. The
Howdy, I have a DataRow pulled out of a DataTable from a DataSet. I
I have a PDF document that needs to be pulled up in the browser,
I have a JSP which attaches a XSL to an XML document pulled from
Have just started using Google Chrome , and noticed in parts of our site,
I am new to the whole iPhone SDK and objective C, but have managed
I have a slider that can be pulled up and then it shows a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.