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 :
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