I have a domain.com which is working perfectly. I have a php script in my domain which is infinite loop which is sleeping with doubled periods (for long polling purposes) lets say infinite.php.
$sleepDuration = 1;
while(true) {
//check database
// do some stuff
if(some new result) {
return jsonresult
} else {
$sleepDuration *= 2;
sleep($sleepDuration)
continue;
}
}
If I execute this script via browser (for test purposes or w/e) with url domain.com/infinite (I use htaccess to remove .php extension in url) this file gets cached and here is the most annoying thing: from this point on domain.com will not respond to browser. Webpage will not open from now on. (I have to clear all my cached files to make it work again).
- How can I prevent caching of such php files ?
- Is there anyway I can remove only this version of php file from the cache ?
P.s: I know it is absurd to execute this script from browser but as I said I would like to learn and manipulate the caching of such files.