How to totally prevent HTTP 304 responses in Connect/Express static middleware?

前端 未结 4 1033
说谎
说谎 2021-02-07 11:05

At times during development, it would be really nice to prevent HTTP 304 responses (in favor of 200\'s), and cause the Connect/Express static middleware to read every r

4条回答
  •  眼角桃花
    2021-02-07 11:59

    I get 200 responses by doing this during development :

    var express = require('express');
    app = express();
    app.use(function(req, res, next) {
      req.headers['if-none-match'] = 'no-match-for-this';
      next();    
    });
    

提交回复
热议问题