>Hello php-general,
>
>      I've recently faced big optimization issues. Here is mine
>situation:
>
>I make connection to NNTP server and fetch headers from the news group
>lets say bla.bla.bla. Connection made ok. Next Php tryes to put
>everything into the array. It's okey if number of headers are lower
>then let's say 100. But if number of headers get greater then 100,
>it's a pain in the ass. I have to wait for 90-100 seconds till the
>operation completes. (I'm talking here about large value news groups).
>So I have faced that I need to optimize it somehow.
>At this point of time i've got only idea is to put all the headers in
>the database. But not sure how to update database frequently. Any
>ideas even fantastic ones are welcome.

Can't you just ask the NTTP server for only the next 20 messages?

You could probably build a local cache of each message, and use that for any
repeated request...

<?php
  get_message($message_id){
    $message = get_cache($message_id);
    if (!$message){
      $message = get_nntp_message($message_id);
      store_cache($message_id, $message);
    }
  }
?>
Exactly where/how you store the local cache is up to you.  Files, DB,
whatever.

Actually, what you *MIGHT* find easiest is to simply install a news server
locally, carry the groups you want, and then have PHP talk to the local news
server.

Then all the caching and expiring issues are taken care of, the news feed
download is automatic, and your PHP application will be talking to a LOCAL
news server, which should be way more faster.

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to