我建立了一个网站,让用户可以上传图片并重新提供服务。为了降低负载,我尝试使用客户端缓存,如下所示:
byte[] data = Files.readAllBytes(path);
response().setHeader(CACHE_CONTROL, "max-age=3600");
response().setHeader(ETAG, image);
return ok(data);
这在开发模式(播放运行)中工作正常,但是当我在生产模式下运行网站时,标题已经消失,没有任何缓存。
由于