SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist smftre's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    436
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Ajax causing page lag

    I have a web app that performs a lot of ongoing ajax requests to keep multiple elements all up to date as time goes by, so there are almost always ajax calls going on in the background - this is neccessary in this situation.

    Now for the problem (aka annoyance), when there's an ajax call in progress page elements all lag, e.g. If I hover over a:hover etc everything lags and if I disable the ajax calls and do the hovers they all respond immediately.

    Is there some kind of way I can stop my ajax calls from making the page feel so damn laggy?
    Statvoo.com The Website Traffic Monitor
    The best way to monitor traffic to your sites for free!


    Web Development London UK We make web 3.0 applications

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by smftre View Post
    I have a web app that performs a lot of ongoing ajax requests to keep multiple elements all up to date as time goes by, so there are almost always ajax calls going on in the background - this is neccessary in this situation.

    Now for the problem (aka annoyance), when there's an ajax call in progress page elements all lag, e.g. If I hover over a:hover etc everything lags and if I disable the ajax calls and do the hovers they all respond immediately.

    Is there some kind of way I can stop my ajax calls from making the page feel so damn laggy?
    You could use a queue system for low-priority calls. You could also perhaps combine several of those low-priority calls together to help reduce the amount of traffic.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •