cachel-control

nodejs:

      res.set('Cache-Control', 'public, max-age=31557600');

express全局设置:

      app.use(express.static(__dirname+"/public",maxAge:120000}))

  

客户端设置:

 方案1:

    xhr.open('get','/123')

    xhr.setRequestHeader('cache-control','max-age=3000')

 方案2:

   meta 现在设置 总会被服务器端覆盖

  <meta http-equiv="Cache-Control" content="max-age=3000"></meta> 并不是好的方案???

???

   

原文地址:https://www.cnblogs.com/kunyashaw/p/10729222.html