views:

438

answers:

2

Strange bug here... ajax has been loading slow on this server since day one... we thought it was the internet connection, until yesterday. I accidentally added an invalid extension into the php.ini file (ie. extension=php_pdf.dll), and then all of a sudden, the ajax loaded extremely fast. When I took out that invalid extension, the ajax loaded slow again. My colleges and I did not create the php config file, so I'm not sure why this is happening... maybe there's a setting turned on in the php config file that is causing the ajax to load slow, and when this invalid extension is included, it skips the setting... not sure. But hopefully someone can help explain this!

If anyone can point me in the right direction to why this is happening, I'd appreciate it! Our slow ajax loading won't be fixed until this is sorted out, and the guy who created the php.ini file no longer works here.

The site is: link text

So if you click there, you'll see how slow the ajax loads. Please help, I can include the php.ini file if anybody wants to see what settings are enabled.

Thanks in advance to any help I receive.

+2  A: 

You may want to install firebug if you are not using it already (it's a webdeveloper plugin for firefox).

I just checked out the site and the data seems to be loading fast enough but it seems the JS is just terribly slow. A hint that something is wrong is also in the net tab that doesn't seem to be able to determine the size of your ajax calls, if the js has that same problem it could cause it to hang waiting for the stream to end.

Looks like misconfiguration in the php.ini, but without its content it is hard to say anything about it really.

Also, if you try to load the ajax call manually, you'll see that the page loads for a long time, but the data shows up almost instantly, and then the connection is not closed immediately.

Ticcie
Thanks so much for your reply. I do use firebug, but I'm not sure how to see how fast data is loaded. It's strange though, if I re-add that broken extension to the php.ini file, the site loads fast... I can do that right now if you want to re-visit the site and see how super fast the ajax loads, just let me know.But I am new to ajax, so it could still be my coding I guess.But if you want to look at my php.ini file to see if anything is messed up, it's right here...http://rapidshare.com/files/280491999/php.ini.html
yes, I just tried to load the ajax call manually like you said, and you are right, the page never finishes loading the ajax... what do you think this means? It sounds like you think it's the js, and not the php.ini file.. I can include the small js/ajax that I'm using to call the pages. I'll include anything at this point, I just want my content to load as fast as it does when I include a faulty extension in the php.ini file.
It is definitely not the JS since that is evaded by loading the page directly. It is something serverside, but I don't see anything really special in the php.ini.You may want to turn off output buffering (set it to Off), but that's just a guess. It is good practice anyway.
Ticcie
alright, well thanks for narrowing it down to the server side and not the coding, that helps a lot. Now I just have to figure out how to go about finding the server side issue. I set output_buffering = Off (originally was set to 4096) like you said, and unfortunately that didn't work. Do you agree I may have to get a profession PHP person in here to figure this out?
I'd recommend getting a standard php.ini file, see what that does, and if that loads ok start adjusting the settings one by one to suit your needs and see where it breaks.
Ticcie
I did this today, and the problem still exists... not sure.. do you think it is a setting on the server itself? Fastcgi or something? I created this simple ajax page: http://beta.charmscorp.com/inspect/test/testAjax2.htm - to see if that can even run, and as you can see, it's slow
A: 

If you are sure the commenting out of the bad dll declaration is having a bearing on this issue, you could try moving it down the list till you find out which other dll is causing the problem.

Did you look in the php start up errors?

ini_set('display_errors','1');
ini_set('display_startup_errors','1');

error_reporting (E_ALL);
Cups
It's so odd. The bad dll declaration doesn't speed up the site anymore... I have no idea why that stopped all of a sudden. I've tried everything and I can't bring back the speed in the ajax.I did try to record error reporting, but no errors on startup are logged.Side note: I created just a simple ajax call that does a simple thing, to test once again if it's the code, and if you go here:http://beta.charmscorp.com/inspect/test/testAjax2.htm - you'll see that when you type in a letter, it takes too long for the suggestion to come up.I'm not sure what to do at this point!