【问题标题】:Why Express shows cached error message after command: forever cleanlogs?为什么 Express 在命令后显示缓存的错误消息:forever cleanlogs?
【发布时间】:2013-11-05 21:43:57
【问题描述】:

我正在使用命令运行快速服务器:

     forever -o /var/www/html/expressapp/out.log 
     -e /var/www/html/expressapp/err.log 
     start /var/www/html/expressapp/index.js -w

节点 v0.8.15

浏览器偶尔会显示非常旧的错误消息,但不是每次都显示 当我转到使用玉模板的一页时。 我很久以前就修复了这个错误,但它仍然出现了几次。 我尝试过使用不同的浏览器并清理了服务器中的每个日志文件,但我无法摆脱该消息。我也改了文件名..

请帮忙!

【问题讨论】:

    标签: node.js express forever


    【解决方案1】:

    这解决了问题:

        app.disable('view cache'); 
        res.setHeader("Cache-Control", "public, max-age=0"); 
        res.setHeader("Expires", new Date(Date.now()).toUTCString());
    

    【讨论】:

      猜你喜欢
      • 2016-12-07
      • 2013-09-14
      • 2021-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-30
      • 1970-01-01
      • 2016-04-25
      相关资源
      最近更新 更多