Article View: news.software.nntp
Article #65700Re: Get newest messages from server
From: Russ Allbery
Date: Tue, 10 Jun 2003 14:52
Date: Tue, 10 Jun 2003 14:52
44 lines
2768 bytes
2768 bytes
Fredrik Jonson <pt97fjo@student.bth.se> writes:
> On a web page I want to present the latest topics on a few newsgroups
> from a newsserver. I'll implement it in php, but that doesn't really
> matter (although php/nntp pointers are welcome! =) as my question is
> what nntp commands to use?
> Is the most efficient way this pseudocode:
> foreach group {
> get the nuber of messages with GROUP
> use XOVER to retrieve the latest (last ten) messages
> put the result in a list
> }
> Or is there a more efficient way to get that information?
If all you care about are the subjects (I'm not sure if that's what you
mean by topics), XHDR subject may be somewhat more efficient. The amount
of work done by the server is probably roughly equivalent, but you're
transferring less data over the network, which can't hurt.
But the above should be about as efficient as you're likely to get.
> Does someone have a performance guesstimate on the commands above?
> Is the XOVER and GROUP data something that is ready and in-memory
> (using INN) or will it require calculations.
For INN, both have to be read from the overview database in disk.
> I'm asking because I'm considering not to use any cache but make a new
> request every time the page is loaded.
If at all possible, you want to cache the open NNTP connection, since the
TCP setup and teardown can be fairly costly. As long as you do that, I
wouldn't worry about doing the above each time someone made a request, as
long as you're not expecting extremely high traffic.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID:
<87fzmiugqv.fsf@windlord.stanford.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mailReferences:
<slrnbebncd.766.pt97fjo@woodcraft.scout.rsn.bth.se>Show Full Headers
Complete Article Headers
Message-ID: <87fzmiugqv.fsf@windlord.stanford.edu> Subject: Re: Get newest messages from server Date: Tue, 10 Jun 2003 07:52:40 -0700 From: Russ Allbery <rra@stanford.edu> References: <slrnbebncd.766.pt97fjo@woodcraft.scout.rsn.bth.se> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail Newsgroups: news.software.nntp Organization: The Eyrie Lines: 43 NNTP-Posting-Host: windlord.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.Stanford.EDU 1055256760 23643 171.64.19.147 (10 Jun 2003 14:52:40 GMT) X-Complaints-To: news@news.stanford.edu User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Common Lisp, linux) Cancel-Lock: sha1:QgavwLlqqe5FZzws5nO2uNUtRdY=