文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>TOMCAT中禁用304返回

TOMCAT中禁用304返回

时间:2010-04-06  来源:gflei

为了调试js文件下载问题,查看网上已有的解决方案:
比较完整的方案: http://blog.bcarlso.net/2007/10/19/tomcat-weak-etags-and-javascript-css-caching

相关讨论:
http://mail-archives.apache.org/mod_mbox/tomcat-users/200806.mbox/<[email protected]>
apache对应的配置方法: http://www.geekride.com/index.php/configure-remove-etags-apache-http-optimize-site/

中文参考网页: 从分析网页缓存机制到解决网页缓存问题 - [JAVA技术] http://itcdn.net/NewsView.asp?id=232

 http 304优化,了解客户端缓存

http://blog.csdn.net/JeamKing/archive/2010/01/07/5153741.aspx
为了快速解决,采用直接修改tomcat源文件:
public class DefaultServlet    extends HttpServlet 


// For GET and HEAD, we should respond with

                // 304 Not Modified.

                // For every other method, 412 Precondition Failed is sent

                // back.

                if ( ("GET".equals(request.getMethod()))
                     || ("HEAD".equals(request.getMethod())) ) {
                    if(!request.getRequestURI().endsWith(".js"))
                    response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
                    response.setHeader("ETag", getETag(resourceAttributes));


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载