我为服务器请求使用HttpUrlConnection,为PUT请求使用HttpResponseCache 缓存response.But响应没有缓存,有人知道原因吗?缓存只用于POST和GET方法吗?
发布于 2014-02-28 18:40:29
某些HTTP方法必须使缓存使实体无效。这可以是Request-URI引用的实体,也可以是Location或Content-Location标头(如果存在)。这些方法包括:
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html)
发布于 2015-06-30 17:37:40
来自HttpResponseCache源代码的注释表明未实现对非GET的缓存:
/*
* Don't cache non-GET responses. We're technically allowed to cache
* HEAD requests and some POST requests, but the complexity of doing
* so is high and the benefit is low.
*/
return null;https://stackoverflow.com/questions/22092637
复制相似问题