# you initialise/calculate $url here if ($ENV{'HTTP_USER_AGENT'} =~ /facebookexternalhit/) { # you only need $url here print "Content-Type: text/html\n\n"; print <<EOM; $url EOM } else { # you don't need $url here print "Location: http://www.youtube.com/watch?v=$video\n\n"; EOM }
You are effectively doing a HTTP GET for every request you get, facebook bot or not.
In reply to Re: Script needs major optimizing.
by Anonymous Monk
in thread Script needs major optimizing.
by Jesse Smith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |