简体   繁体   中英

Cache Issues with Express.js 4.0 in development

I've generated a brand new express.js app with the express-generator but when I'm trying to do some changes, nothing is taking in consideration while reloading in the browser.

I've tried everything we can find on the internet.

  • Disable Chrome Cache (with dev inspector or CMD + MAJ + PR0N)
  • Use app.disable('etag');

I'm running the server with the given command-line DEBUG=testApp:* ./bin/www

And here's what the console give me when I'm accessing the localhost:3000 :

GET / 200 7.885 ms - 179
GET /stylesheets/style.css 304 10.014 ms - -

Thanks in advance for helping, I'm sure it will help alot of people.

EDIT : After doing some experimentations, the .jade files are not cached but all the functional stuff like routes and node.js part aren't reloading.

Answer made by adeneo in comments on the first thread.

It was just because Node.JS application need a restart from the server for taking in consideration modifications made on .js files.

nodemon reload the server each time a save on .js files has been detected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM