0

I am creating site very similar to alltop.com

My home page use fetch_feed function 20 times for 20 different blogs. Using wp_feed_cache_transient_lifetime I have set cache time to 2 hours.

My problem is every two hour, when my blog try to call fetch_feed 20 times, I am afraid that it will slow down my site very slowly and may be banned my site by hosting company also.

Is there any way to overcome my problem?

3
  • Fetching 20 feeds has that problem, not WordPress itself; I mean, fetching 20 external feeds may have similar performance issues, either if you use WordPress or not. Try to do it in the background, one by one, and not during page load. For example, using scheduled events.
    – cybmeta
    Commented Oct 26, 2016 at 6:10
  • @cybmeta As I know wp_schedule_event also run when visitor land to the site and if schedule time is passed. So assume that I have set 2 hour as schedule time. There is no any visitor for last 4 hour. So when new visitor land to the site again WordPress try to fetch 20 external feeds. So performance problem is also there even I use wp_schdule_event. Am I right or wrong?
    – Damithatt
    Commented Oct 26, 2016 at 6:20
  • You can set it up to run in the background with a server cron-job and disable it for users. There are several ways, I like to use WP Cron Control. Anyway, as I said, I think that this prerfomance issue has nothing to do with WordPress itself.
    – cybmeta
    Commented Oct 26, 2016 at 6:46

1 Answer 1

1

The performance issue of fetching that amount of feeds from external sites is not related with WordPress at all, but it can be solved in WordPress easily.

  1. Set up a escheduled event that fecth the feeds, one by one could be better.
  2. Disable WP Cron for users and set it up to run using a server cron job.

This way, you fetch the feeds in the background and serve the data without blocking the user experience.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.