简体   繁体   English

tomcat 5.5响应头缓存

[英]tomcat 5.5 response header cache

I wanna know please how this "expires times" has generated (please see the reponse header in the screen) 我想知道这个“过期时间”是如何产生的(请在屏幕上查看响应标题)

Expires:Wed, 31 Dec 1969 19:00:00 ACT 过期:1969年12月31日星期三19:00:00 ACT

The application is two slow. 该应用程序很慢。 everytime sends 304 (for .js, .css) but it's take a long time to make the 304 reponse and return 0 Bit (in size). 每次发送304(对于.js,.css),但要花很长时间才能做出304响应并返回0位(大小)。

what is the best practice to do cache with tomcat? 用tomcat进行缓存的最佳实践是什么? what i have to change in my application? 我需要在应用程序中进行哪些更改? i wanna the .js and .css to be cached, and check the server for a new version every time sometimes has changed or after a certain delay. 我想将.js和.css进行缓存,并在每次有时更改或经过一定延迟后检查服务器的新版本。

can you please tell me if there is something wrong with the request/response header in the image below? 您能否告诉我下图中的请求/响应头是否有问题?

can't understand why the latency is too high 781 ms and finally get 0Bit. 无法理解为什么延迟时间过长781毫秒并最终获得0Bit。 why all this times? 为什么所有这些时间?

the response screen : http://postimg.org/image/jce62vqbz/ 响应屏幕: http : //postimg.org/image/jce62vqbz/

tomcat : 5.5 雄猫:5.5

jdk : 1.6 JDK:1.6

thanks a lot, best regards. 非常感谢。

in your dynamic page creation you are setting negative expires which shall generate past date from 1969. i think you are using 在动态页面创建中,您设置的是负数到期时间,该时间应生成从1969年开始的过去日期。我认为您正在使用

response.setDateHeader("Expires", -1); response.setDateHeader(“ Expires”,-1);

that means the page already expires and it will reload everything(include js,css) each time. 这意味着该页面已经过期,并且每次都会重新加载所有内容(包括js,css)。

so please remove it. 所以请删除它。 it will solve your issue. 它将解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM