Multi-Threading in PHP with pthreads
A Brief Introduction to Multi-Threading in PHP
By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk.
This process is outlined at the Nginx ngx_http_fastcgi_module page manual page.
|Copyright (c) 2015, Shahar Evron|
|All rights reserved.|
|Redistribution and use in source and binary forms, with or without modification,|
|are permitted provided that the following conditions are met:|
|1. Redistributions of source code must retain the above copyright notice, this|
|list of conditions and the following disclaimer.|
|2. Redistributions in binary form must reproduce the above copyright notice,|
|//get the last-modified-date of this very file|
|//get a unique hash of this file (etag)|
|$etagFile = md5_file(__FILE__);|
|//get the HTTP_IF_MODIFIED_SINCE header if set|
|$ifModifiedSince=(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : false);|