OfflineMode plugin on new share host
4 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: 3 hours ago (RSS)
Hi Jeff,
I am assuming here that you are using offlineMode v1.02.
Around line 264 in the offlineMode_getUrl() function, you see a $curl_options being set with CURLOPT_USERAGENT. Change that line to...
$curl_options = [CURLOPT_USERAGENT => $userAgent, CURLOPT_TIMEOUT => 10];
You can give that a try and test different values. You don't want it to be too long. Currently the default is set to 4.
I believe that will achieve what you are looking for when it comes to setting CURL timeouts. I am not sure if this is going to solve the issue if the script is hanging for another reason. Worth giving it a try.
Let us know if it works out for you.
Senior Web Programmer
Interactivetools.com
Thanks for sharing the details, John. Tim's suggestion to raise the timeout makes sense as a first step, and I would test it in small steps, for example 10 seconds first, then a little higher if the host is still slow, instead of jumping straight to a very long timeout. It can also help to log how long the request actually takes before it fails, so you can tell whether it is a slow connection to the host or a slow response from the remote check. If the new shared host is much slower than the old one, checking DNS lookup time and whether the host blocks or delays outgoing requests can also point to the cause. Did the longer timeout help on your new host?