Skip to content

Commit

Permalink
Provide background on why curl multi may be unavailable
Browse files Browse the repository at this point in the history
Co-Authored-By: Will Washburn <will.washburn@gmail.com>
  • Loading branch information
westonruter and willwashburn committed May 19, 2019
1 parent 610ec1f commit dcf0fcc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/FasterImage/FasterImage.php
Expand Up @@ -68,6 +68,17 @@ class FasterImage
*/
public function batch(array $urls)
{

/**
* It turns out that even when cURL is installed, the `curl_multi_init()
* function may be disabled on some hosts who are seeking to guard against
* DDoS attacks.
*
* @see https://github.com/ampproject/amp-wp/pull/2183#issuecomment-491506514.
*
* If it is disabled, we will batch these synchronously (with a significant
* performance hit).
*/
$has_curl_multi = (
function_exists( 'curl_multi_init' )
&&
Expand Down

0 comments on commit dcf0fcc

Please sign in to comment.