Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2249039
  • 博文数量: 310
  • 博客积分: 6853
  • 博客等级: 准将
  • 技术积分: 2833
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-04 16:41
文章分类

全部博文(310)

文章存档

2013年(17)

2012年(42)

2011年(76)

2010年(71)

2009年(99)

2007年(2)

2006年(1)

2005年(2)

分类: 系统运维

2010-04-06 16:51:46

为了调试js文件下载问题,查看网上已有的解决方案:

比较完整的方案:


相关讨论:

apache对应的配置方法:


中文参考网页:
从分析网页缓存机制到解决网页缓存问题 - [JAVA技术]

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


为了快速解决,采用直接修改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));


阅读(7548) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~