Thread View: news.software.nntp
2 messages
2 total messages
Started by Fredrik Jonson
Tue, 10 Jun 2003 13:30
Get newest messages from server
Author: Fredrik Jonson
Date: Tue, 10 Jun 2003 13:30
Date: Tue, 10 Jun 2003 13:30
24 lines
1587 bytes
1587 bytes
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?
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. I'm asking because I'm
considering not to use any cache but make a new request every time
the page is loaded.
--
Fredrik Jonson
Re: Get newest messages from server
Author: 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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads