SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem in page loading

    Hi Everyone

    I need small help. I using two div in my site . First div(left) is coming from server cache and its being loaded very fast but the second div (right) is fetching values from database so its appearing in screen very very slow. Is there any way to show the div slowly-slowly as data will fetched by the browser. I know there is one script, but i missed it some how so pls help if any one know this....

  2. #2
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i thought i will get the answer today but no one is giving me the solution. Is it impossible to this. I do't think so pls tell me how to load the div's content one by one.

  3. #3
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you loading the content - with Ajax? Load the second div's content first and load the first one onComplete of the second loading.

  4. #4
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    NO i am not using ajax its simple database fetching using php & mysql. And i can't display second and then 1st coz this will make the web site again slow. because 1st div content is coming from cache so its loaded fast and no need to fetch fresh data but in 2nd div i am showing wiki database like latest blog post , forum post so while retriving these values its taking time so i need a script which load the content as i will receive the content,i do't want to wait for all content.

  5. #5
    SitePoint Enthusiast nickweavers's Avatar
    Join Date
    Feb 2004
    Location
    Hampshire, UK
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is you are getting back that takes so long? Typically, dynamic pages built with content from a database using php are built on the server (php is a server side language as you know) after the query has returned the requested data.
    If your query is taking a long time is it because

    1) the query takes a long time to perform?
    2) it returns a lot of data?

    If the answer is 1) maybe you can tune your query to perform better

    If the answer is 2) maybe you could paginate the results so you limit the amount of data you get back using mySQL's LIMIT keyword on the query. You will have to include php code to handle the page navigation (ie walking forwards and backwards through the pages). This can be done via a form to redisplay the page after the query has been redone with the new limits supplied, or using ajax to update the page "in place".

    It might help the readers here provide suggestions if you gave a liitle more information about your problem. ;-)


Bookmarks

Posting Permissions

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