views:

310

answers:

1

On my service, I've added the following method:

    protected override void OnStartProcessingRequest(ProcessRequestArgs args)
    {
        base.OnStartProcessingRequest(args);
        HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.Public);
        HttpContext.Current.Response.Cache.SetMaxAge(new TimeSpan(1, 0, 0));
    }

My client is the regular generated .net client. Nothing appears to be cached. It's going to the server on every request. What needs to be done to enable caching? Thanks, -jaa

A: 

You are trying to do HTTP caching however ADO.NET Data Services is being smarter and making sure client driven caching like this does cause old data to come through.

If you want to due client driven caching you need to set the ETag

Robert MacLean