No cache in Node.js server

前端 未结 6 766
北荒
北荒 2020-12-14 05:34

I have read that to avoid caching in Node.js, it is necessary to use:

res.header(\'Cache-Control\', \'no-cache, private         


        
6条回答
  •  佛祖请我去吃肉
    2020-12-14 06:11

    After spelunking through source code for the express and fresh modules, this works from the server side (before res.end is called):

    req.headers['if-modified-since'] = undefined;
    req.headers['if-none-match'] = undefined;
    

    Nasty, but it works.

提交回复
热议问题