I'm having an issue on my Windows environment with Node.Js/Express.js whereby static JS files can be marked as 'pending' in the browser (with caching disabled) for up to two minutes, after which they seem to download fine. This usually happens after a few refreshes.
There aren't any errors shown, so I'm not sure how to investigate further. The same code runs fine on a Mac OSX environment.
Node version is v0.10.31, Express is 4.8.5.
Code for static file is:
app.use(express.static(path.join(__dirname, 'public')));
Chrome DevTools shows:
I had the same problem. The solution for me was to set the resave property of express-session to false.
app.use(session({ resave : false, ... }));
My configuration: node v0.10.31, express v4.9.0, express-session v1.8.1
As session storage I use connect-mongo v0.4.1.
Hope this helps you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With