> $rss = simplexml_load_file($_GET['url']);
> $result = array('language'=>$language,'timezone'=>$timezone);

Great  googlymoogly,  you're  downloading  the  entire  RSS  feed  and
constr'ing  a  SimpleXML  just to get some stuff from the top? And you
might be running this, oh, 200 times a second (synthetic estimate with
100 users)?

RE!

THINK!

If  somebody  forced  me  to  accept  a client connection and outbound
connection  on  every  feed request -- assuming I couldn't change that
assumption  -- bet I wouldn't waste time getting and parsing the whole
XML doc. Open a socket connection to the remote server, get first 500B
maybe,  work  with  that as a string and look for the tz and lang. You
don't  find  it there, only then fall back to the first 2K, etc. (True
range  request  would  be  neater,  but  given  the  unknown number of
different domains you have to deal with, it wouldn't work everywhere.)

But  of  course  I  think  that  the overall 2-connections-per-client-
per-feed architecture is way wrong.

-- S.

Reply via email to