CloudFilt module for Drupal and timeouts
vv
Well, CloudFilt is a nice service, only very slow in its API responses. And it timeouts on the Drupal side, presenting an error message that the site has internal problems and the page could not be displayed.
To fix this, edit the file modules/cloudfilt/src/StackMiddleware/CloudfiltStackMiddleware.php and find the following passage:
// Send request to CloudFilt web service.
$cloudfilt_url = 'https://api' . $config->get('key_site') . '.cloudfilt.com/phpcurl';
$cloudfilt_request = $this->httpClient->request('POST', $cloudfilt_url, [
'form_params' => [
'ip' => $user_ip,
'KEY' => $config->get('key_back'),
'URL' => $user_request_uri,
],
'timeout' => 1,
]);
$cloudfilt_response = $cloudfilt_request->getBody()->getContents();
and change the 'timeout'
value from 1
to 10
.