|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
chieduo Smarty n00b
Joined: 28 Jul 2010 Posts: 2
|
Posted: Wed Jul 28, 2010 1:28 pm Post subject: Commentted DB Connection |
|
|
I took out instances of db connections in putCache and getCache the new google map api allows for 1000 or so requests from one ip address a day. So each visitor can do 1000 requests therefore I don't see the need for a second or two second delay for caching requests. I guess it all depends on how many requests you do per day. |
|
Back to top |
|
chieduo Smarty n00b
Joined: 28 Jul 2010 Posts: 2
|
Posted: Wed Jul 28, 2010 1:52 pm Post subject: Final step to making your script faster |
|
|
change fetchURL to
function fetchURL($url) {
//return file_get_contents($url);
return $this->curl_get_file_contents($url);
}
and add curl_get_file_contents
function curl_get_file_contents($URL)
{
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $URL);
$contents = curl_exec($c);
curl_close($c);
if ($contents) return $contents;
else return FALSE;
}
I know this is old but if this problem is still bothering you like it did with me this solution was a life saver |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|