O'Reilly logo

Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications by Steven Cheng

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Applying OutputCache in a REST service

In WCF REST service development, we will often encounter some cases in which we will return certain data that is very expensive to generate or is not frequently changed. For such REST service operations, WCF 4.0 adopts the OutputCache feature in ASP.NET web application platform so that the response of WCF REST service operations can also be cached at the server side according to some user-defined cache profile settings.

In this recipe, we will show you how to use the OutputCache feature in a WCF REST service.

How to do it...

The following steps will guide you in how to apply a simple OutputCache profile (which makes the operation response be cached for 30 seconds) onto a sample REST service:

  1. Define an OutputCache ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required