HttpResponse supports a basic throttling mechanism : HttpResponse : Development PHP Source Code


PHP Source Code » Development » HttpResponse »

 

HttpResponse supports a basic throttling mechanism


HttpResponse supports a basic throttling mechanism, which is enabled by setting a throttle delay and a buffer size. PHP will sleep the specified amount of seconds after each sent chunk of specified bytes.
<?php    
// send 5000 bytes every 0.2 seconds, i.e. max ~25kByte/s    
HttpResponse::setThrottleDelay(0.2);    
HttpResponse::setBufferSize(5000);    
HttpResponse::setCache(true);    
HttpResponse::setContentType('application/x-zip');    
HttpResponse::setFile('../archive.zip');    
HttpResponse::send();    
?>


HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Development
» HttpResponse