2013-10-15 27 views
0

我使用命令運行Express服務器:爲什麼Express在命令後顯示緩存的錯誤消息:forever cleanlogs?

 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

瀏覽器顯示很老的錯誤消息偶爾,但不是每一次 當我去到一個網頁,其中使用玉石模板。 我很久以前修復了這個錯誤,但它仍然會出現一些時間。 我試過不同的瀏覽器,並清除服務器中的每個日誌文件,但我無法擺脫消息。我也更改了文件名..

請幫忙!

回答

0

這解決了這一問題:

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