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 7500551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:13:29+00:00 2026-05-29T20:13:29+00:00

I have several (24) external xmlfeeds showing products on my frontpage. See this stackoverflow

  • 0

I have several (24) external xmlfeeds showing products on my frontpage. See this stackoverflow question for the details of the feeds. Each feed shows one product, but it takes ages to load those feeds each time someone visits my site. The feeds are updated once a day.

What is the best way of caching these feeds? Should i do something with mysql or save xml files locally. I’m not sure where to start. I tried JG_Cache, but without luck.

This is the loop i use:

<?php
    // get xml file contents
    $xmlurl = get_post_meta( get_the_ID( ), 'plus_xmlfeed', true );
    if ( !empty( $xmlurl ) ){
    $xml = simplexml_load_file($xmlurl);
    }
    $xml->product->name = substr($xml->product->name, 0, 30).'...';
    $desc = substr($xml->product->name, 0, 50).'';
?>

    <li class="span3">
      <div class="thumbnail">
      <a href="<?php echo $xml->product->productURL ;?>">
          <center><img src="<?php echo get_template_directory_uri(); ?>/img/logos/<?php echo get_post_meta(get_the_ID( ), 'plus_logos', true); ?>.gif"/></center>
          <center><img class="mainimg" alt="" src="<?php echo $xml->product->imageURL ;?>"/></center>
        </a>
        <div class="caption">
          <h5><a href="<?php echo $xml->product->productURL ;?>"><?php echo $xml->product->name; ?></a></h5>
          <div class="maindesc half clearfix"><div class="prijs">&euro; <?php echo $xml->product->price ;?></div><strike style="color: rgb(248, 148, 6);">
            <?php
            foreach ($xml->product->additional->field as $field) {
                               switch((string) $field['name']) {
                                   case 'price_advice':
                                      echo '&euro; ' .$field. '';
                                      break;
                                   case 'fromPrice':
                                      echo '&euro; ' .$field. '';
                                      break;
                                   case 'oldPrice':
                                      echo '&euro; ' .$field. '';
                                      break;
                                   case 'from_price':
                                      echo '&euro; ' .$field. '';
                                      break;
                                   case 'adviesprijs':
                                      echo '&euro; ' .$field. '';
                                      break;
                                   case 'advice_price':
                                      echo '&euro; ' .$field. '';
                                      break;
                                   case 'Fromprice':
                                      echo '&euro; ' .$field. '';
                                      break;
                                   case 'recommendedPrice':
                                      echo '&euro; ' .$field. '';
                                      break;
                                    }
                                }
            ?>
            </strike>
          <p style="color: rgb(153, 153, 153);"><?php echo $desc; ?></p></div>
          <div class="btn-group bot"><div class="pull-right"> </div><a class="btn btn-primary" href="<?php echo $xml->product->productURL ;?>">Kopen</a> <a class="btn" href="#<?php echo 'modal_'.get_the_ID();?>">Info</a></div>
        </div>
      </div>

    </li>
<?php /*end loop*/ ?>
  • 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-29T20:13:31+00:00Added an answer on May 29, 2026 at 8:13 pm

    To answer your immediate question, consider the following pseudo code:

    1. Check for existence of local file with xml contents. Something like /home/db/tempfiles/feed_name_current_date.xml

    2. If no matching local local file can be found using the construct from step 1, then load the xml as your doing now

    3. After xml has been loaded from URL, save contents using a namespace construct with feed_name and current_date, so when a new request is made, step 1 will return the local file

    I’m curious though, if it’s an xml feed, do you not want to store the data in your local system? How do you track purchases etc?

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

Sidebar

Related Questions

I have several external tables used to read file data into the DB each
I have several images stored in content://media/external/images/media. I would like to display by using
We have several webapps, as well as an external device authenticating against the same
I have several Java applications. All of them have external jar dependencies and also
I have a index.php file that will include several external files: content/templates/id1/template.php content/templates/id2/template.php content/templates/id3/template.php
I have several xml files that are formated this way: <ROOT> <OBJECT> <identity> <id>123</id>
we have several tens of macro enabled excel files, each of those contains few
I have several JAR file pattern sets, like <patternset id=common.jars> <include name=external/castor-1.1.jar /> <include
I have several inline jqueries, how can I move them into one single external
I have a jquery page that loads parts stored in several external files. I

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.