PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 14, 2022

[FIXED] Chrome timeout Ajax request after 120 seconds?

 January 14, 2022     google-chrome, jquery, lamp, php     No comments   

Issue

I am not sure if it is a bug or configuration error but I keep getting ajax requests "canceled" at exactly 120 seconds. No http response code given.

The server side is running on a LAMP stack and the php max_execution_time is set to 240 seconds using mod_php5

Oddly enough, if I request the same page without ajax, it won't timeout after 120 seconds.

Early tests shows that firefox does the same thing.

Can anyone help with this bug/annoyance?

Sample code

set_timeout_limit(o); 
sleep(1000);

Solution

try to add timeout: xxx (in ms) to your AJAX call

example:

$.ajax({
  url: "test.html",
  timeout: 240000,
  context: document.body,
  success: function(){
    $(this).addClass("done");
  }
});


Answered By - Inoryy
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing