Journal    Photos    Links

October 05, 2002

Pub-sub and caching of info from web services

Consider the following scenario: there is a piece of information that a web service provides. I have multiple applications running on my PC that are interested in this piece of information. Will my (web services optimized) OS be cognizant of this fact and cache and distribute this information intelligently? Or would my apps operate in ignorance of each other and each have to make a trip to the network if it wanted an update on the information.

Here the scenario that got me thinking about this: Suppose there is a "presence" web service that provides information on when my buddies are online. Also suppose I have two applications running on my desktop that both want to display this presence information- an email client and an instant messaging client. When one of my buddies comes online, would the web service have to send two messages to my machine? One for the email app, and one for the IM app? Or could it just send a message to my device and trust that my device knows which apps are subscribed to this information? This seems much more efficient, especially if we start thinking of networks caching this information in addition to devices. If everyone in my company is running a stock ticker on their computer, and a lot of us are watching the same stocks, why should each device have to go out to the internet to retrieve the information? Wouldn't it be better to first see if my local network is already carrying this information and use the internet as a fallback mechanism?

Posted by tbailen at October 5, 2002 02:38 AM
Comments

I would expect MS to implement something like this eventually. Though since it's not in XP, and the next desktop OS isn't due for 4-5 years, I wouldn't expect it anytime soon.

What you might be looking for is something like an HTTP proxy. This could sort of do what you want. The thing is, most web service requests will return different info based on the arguments passed in (much like CGI scripts, JSPs, etc). This makes it very difficult to cache the responses without returning potentially bad info. The way around this is for the web service to return appropriate cache control headers (same goes for web sites, incidentally). Regrettably, almost nobody actually does that.

Oh, a bit of nitpicking. You have the direction of your web services reversed. A web service would never send messages to your machine, rather your machine would send request to the web service. It works precisely the way HTTP works, since HTTP is the most common transport.

Posted by: Brian on January 9, 2003 03:46 PM
Post a comment