【发布时间】:2010-02-16 01:55:31
【问题描述】:
我从 Jersey @GET 方法返回了以下内容。它可以正常工作,但始终包含 No-cache 标头。我想允许客户端缓存这些数据,因为它很少更改。
ResponseBuilder rb = Response.ok(c);
CacheControl cc = new CacheControl();
cc.setMaxAge(60);
cc.setNoCache(false);
return rb.cacheControl(cc).build();
响应总是:
Server Apache-Coyote/1.1
Pragma No-cache
Cache-Control no-cache, no-transform, max-age=60
Expires Wed, 31 Dec 1969 19:00:00 EST
Content-Type application/xml
Content-Length 291
Date Tue, 16 Feb 2010 01:54:02 GMT
我在这里做错了吗?
【问题讨论】: