3 ms·
You should look into caching the results from the XML feeds in a database, as well as caching the output of your app. For example, if your app needs to pull we
by byoung2 16y ago
You should look into caching the results from the XML feeds in a database, as well as caching the output of your app. For example, if your app needs to pull weather data from one XML feed by city, and stock quotes from another by ticker symbol, consider using a cron to pull these at 5,10,15 minute intervals and store them in a database. Then, have your app always look at the database for the data. You can even cache these queries using memcached, etc. Then, cache the output of your app in a static file and serve that with a 5,10,15 minute timeout. Most of the time your users will get the static cached file, and if not, they will get a page generated from a memcached query result, or pulled from the local database.
You never want to serve up that many XML feeds live because when one of them is slow or down, so is your site.
- kingofspain 16y agoSecond this. I built a similar site a year back and what I did was pull in the UK XML data daily (the feed was updated daily) and database that mother. I'm not sure how often Expedia updates its hotel prices, but you could maybe poll every couple of hours instead. We also had a free search for anywhere in the world, so we'd pop up a spinner and grab the XML. Then we'd cache that result set in the DB with a rudimentary script and store it for the next 24 hours. That would then be served to anywhere searching for the same thing in the meantime. Overall, it sped things up dramatically.