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

4

2 回答 2

0

您正在尝试进行 HTTP 缓存,但是 ADO.NET 数据服务变得更加智能,并确保像这样的客户端驱动缓存确实会导致旧数据通过。

如果你想由于客户端驱动的缓存,你需要设置ETag

于 2009-07-15T14:33:13.003 回答
0

任何真实的 ETag 示例?

到目前为止,仅对非真实示例的垃圾参考

于 2010-12-18T22:02:58.853 回答