Merhaba arkadaşlar
<script>
function loadXMLDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("link_wrapper").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "https://xxx.com/siparis.php?uye=<?php echo $uye_id;?>", true);
xhttp.send();
}
setInterval(function() {
loadXMLDoc();
// 1sec
}, 1000);
window.onload = loadXMLDoc;
</script>
kodlarım bu şekilde siparis.php 'yi 1 sn de bir girip link_wrapper içersine yazdırmaya çalışıyorum. Ama sayfa ilk yüklendiği anda cache alıyor gibi veriler yenilenmiyor. Var mı problemin çözümünü bilen?
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
siparis.php içersine cache kontrollerimide ekledim ama malesef sonuç halen aynı.
Örnek Uygulama :
https://www.youtube.com/watch?v=SkQTMwGLbh4