papadi Development Blog

.NET and Software Development by Dimitris Papadimitriou 
« Back to blog

Use REST and let others do the caching for you

I run into an (one year) old article of Udi Dahan today. He explains how REST can be used to scale up an application, of course without the need to add additional hardware.

The idea is simple. If you have a SOAP web service that thousants of clients call, then a common practice would be to add caching behind it, in order to avoid hitting your database (or other resources) for each request. Common and cheap practice that works up to some extend.

However, If you use REST instead of SOAP for your service, then your responses are simple HTTP responses. Therefor you can add some HTTP headers in them, forcing the intermediates of the communication (proxy servers for example) to cache the response themselves. The result would be that when the client tries to hit your server, intermediate servers will return the cached response instead of hitting your server. Nice!!!

Read the article...

Comments (0)

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    twitter