Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

My Ajax sends 11 KB text to PHP code. So it takes too much time to send data and takes too much time to execute.

Here is my code :

JavaScript
var xmlhttp;
        	if (window.XMLHttpRequest){
        		xmlhttp = new XMLHttpRequest();
        	}else{
        		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        	}
        	xmlhttp.onreadystatechange = function(){
        		if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
        			var replay = xmlhttp.responseText;
        			alert("Response");
        		}
        	}
        	xmlhttp.open("generatereportT","xxx.php",true);
        	var variable = 'Here 70 KB text';
        	xmlhttp.setReprquestHeader("Content-type", "application/x-www-form-urlencoded");
        	xmlhttp.setRequestHeader("Content-length", variable.length);
        	xmlhttp.send(variable);


I am using 'Godaddy' server. After Analysis I was found that it provides slow hosting speed.

I don't know why it works slow. I think there are 2 reasons for that :

- Godaddy provides slow hosting speed
- AJAX sends too much long data

Can anybody help me, please! thanks in advance ...

What I have tried:

- Try to compress text and sens to php
- change .htaccess like gzip, deflate etc. After doing this I get some fast speed but I need faster speed
Posted
Updated 16-Jul-16 3:02am
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900