Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    May 2008
    Posts
    25
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Quick Question - Slow loading php

    I have a site that allows people to add their facebook, myspace, youtube, etc. accounts and get new messages, friend requests, etc from my page.

    The problem with this is that...the more sites that a user adds, the slower loading the page becomes, because it has to wait for each site's response.

    Question: Is there a way to fix this? Perhaps loading the functions after the page loads or something?

    Any ideas are appreciated!

  • #2
    LAMPE
    Guest
    unfortunately you are going to have to wait since you are pulling data from external servers. also be very careful with this because you are pretty much leeching their bandwidth and if you are making any money off that you could get in a lot of trouble.

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    You could use AJAX to query each site individually after the page loads, and that way you could show some progress information.
    Quote Originally Posted by LAMPE View Post
    also be very careful with this because you are pretty much leeching their bandwidth and if you are making any money off that you could get in a lot of trouble.
    That's not really bandwidth leeching. You aren't linking them to some on another site's server or anything. You're logging in(presumably) to their account on the other site's server, and retrieving their friends list just as if they had browsed there. At worst you could say that the site might be losing ad revenue, but huge sites like Facebook/MySpace/Youtube, etc. aren't likely to care much, if they even notice.
    Last edited by Inigoesdr; 05-19-2008 at 12:35 AM.

  • Users who have thanked Inigoesdr for this post:

    ironj221 (05-19-2008)

  • #4
    Regular Coder
    Join Date
    Sep 2006
    Location
    Vermont, USA
    Posts
    154
    Thanks
    0
    Thanked 6 Times in 6 Posts
    I ran into a very similar problem during the Search result functionality of jigadig.com. We aggregate auction search results into a single interface from sites like ebay, amazon, ubid, etc.

    The solution -to make the page appear to load faster - was to do the whole thing with ajax as mentioned above. It came out really well, i suggest you take a look as it might lead you in the right direction.

    http://www.jigadig.com/Search/All/?satitle=DVD
    Active PHP/MySQL application developer available for immediate work.
    syosoft.com mavieo.com - Remote Web Site Administration Suite - Reseller Ready

  • Users who have thanked syosoft for this post:

    ironj221 (05-19-2008)

  • #5
    New Coder
    Join Date
    May 2008
    Posts
    25
    Thanks
    6
    Thanked 0 Times in 0 Posts
    also be very careful with this because you are pretty much leeching their bandwidth and if you are making any money off that you could get in a lot of trouble.
    I don't think this is a problem because each of these sites has an API that allows you to pull information from their site which I am using. Also, I'm only getting the number of new messages -- then the user must go to the site to view them or interact.

    Thanks for the ajax tip, I will deffinately consider this option and appreciate your feedback.

    BTW, your Jigadig site is a very cool idea! It's too bad the search results take so long for each site.

  • #6
    Regular Coder
    Join Date
    Sep 2006
    Location
    Vermont, USA
    Posts
    154
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Yea, 1/2 the problem is that these sites dont have an official API, and the ones that do don't provide all of the desired information in a single call.
    Active PHP/MySQL application developer available for immediate work.
    syosoft.com mavieo.com - Remote Web Site Administration Suite - Reseller Ready

  • #7
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    Quote Originally Posted by syosoft View Post
    I ran into a very similar problem during the Search result functionality of jigadig.com. We aggregate auction search results into a single interface from sites like ebay, amazon, ubid, etc.

    The solution -to make the page appear to load faster - was to do the whole thing with ajax as mentioned above. It came out really well, i suggest you take a look as it might lead you in the right direction.

    http://www.jigadig.com/Search/All/?satitle=DVD
    Doesn't seem like that solved the problem. It never even seems to load the page. Just sits there transferring content/waiting.

  • #8
    Regular Coder
    Join Date
    Sep 2006
    Location
    Vermont, USA
    Posts
    154
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Aedrin, Why dont you be a gem and provide your os/browser choices because as far as I can tell, pure ajax load coupled with infinite scroll is working quite well.
    Active PHP/MySQL application developer available for immediate work.
    syosoft.com mavieo.com - Remote Web Site Administration Suite - Reseller Ready

  • #9
    New Coder
    Join Date
    May 2008
    Posts
    25
    Thanks
    6
    Thanked 0 Times in 0 Posts
    I just wanted to thank you both again -- I implemented the ajax and it works great!
    Something I didn't even thing about, it also solves the problem of the site not loading when an external site was unresponsive.
    Last edited by ironj221; 05-20-2008 at 01:45 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •