I am just in the process of thinking through the architecture of an application, and would like thoughts on the most efficient (bandwidth, processing time) way to call the database results from a remote site... What I mean is this...

Assume "Site A" is a remote site on a different server/domain/IP etc. from my database server. I am placing text links on Site A by calling the database to see which links are to be displayed on any particular page by capturing the URL of the page that is displaying the link and looking up that page in the database to see which links are assigned to that page (through PHP or ASP depending on the site) When I am talking about text links, I mean static text links would be displayed that a search engine spider will read as if they were hard coded html... not a cgi app or something similar.

Now... I assume the only way to do this is to have an output page on my database server and call to it by passing the parameters. However, this looks like it would eat tremendous bandwidth by making a call to the database results page each time a page is accessed, if there are hundreds of "Site A's" with hundreds of pages on each site...

Is there a better way to do this? Am I missing something simple that will reduce the bandwidth issue... or is it not that bad to begin with?