mweibel / connect-session-sequelize

Sequelize SessionStore for Express/Connect
212 stars 72 forks source link

Duplicate database queries? #114

Closed bhairava3 closed 4 years ago

bhairava3 commented 4 years ago

Hi, I just started learning node.

server.js server.js

middleware.js middleware.js

After requesting the server only 1 time, 4 database queries appear on the command line, instead of the expected two, is that correct?

cmd: cmd

mweibel commented 4 years ago

if you run the server with the env variable DEBUG set to * you'll see more info on what happens. Usually browsers request more than just the index, maybe e.g. the favicon is also routed through node and therefore triggers a session select/update.

It's cool that you learn to code and that you inspect everything you do, however you might be focusing on the wrong thing if you start by suspecting performance issues in libraries ;)

bhairava3 commented 4 years ago

TNX :+1: