{"action":"created","issue":{"url":"https://api.github.com/repos/meanjs/mean/issues/1109","labels_url":"https://api.github.com/repos/meanjs/mean/issues/1109/labels{/name}","comments_url":"https://api.github.com/repos/meanjs/mean/issues/1109/comments","events_url":"https://api.github.com/repos/meanjs/mean/issues/1109/events","html_url":"https://github.com/meanjs/mean/issues/1109","id":122699577,"number":1109,"title":"Initialize Static Routes  before session initalization","user":{"login":"sparshy","id":8553391,"avatar_url":"https://avatars.githubusercontent.com/u/8553391?v=3","gravatar_id":"","url":"https://api.github.com/users/sparshy","html_url":"https://github.com/sparshy","followers_url":"https://api.github.com/users/sparshy/followers","following_url":"https://api.github.com/users/sparshy/following{/other_user}","gists_url":"https://api.github.com/users/sparshy/gists{/gist_id}","starred_url":"https://api.github.com/users/sparshy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparshy/subscriptions","organizations_url":"https://api.github.com/users/sparshy/orgs","repos_url":"https://api.github.com/users/sparshy/repos","events_url":"https://api.github.com/users/sparshy/events{/privacy}","received_events_url":"https://api.github.com/users/sparshy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-17T09:51:02Z","updated_at":"2015-12-17T11:06:29Z","closed_at":"2015-12-17T11:06:29Z","body":"There is a very good explanation for this [here](https://www.airpair.com/express/posts/expressjs-and-passportjs-sessions-deep-dive)\r\n\r\n\r\nAvoid Sessions for Static Resources\r\nI learned that if you add the session middleware before your static directory, Express will generate     sessions for requests on static files like stylesheets, images, and JavaScript.\r\nIf a new visitor without a session loads a page with 10 static files, the client's browser will not yet have     a cookie and will send 10 cookieless requests all triggering Express to create sessions. Ouch! So that's     what was happening... If you haven't done something smart to detect bots and scrapers, things can blow     out pretty quickly!\r\nSimply put your static files first, or better yet on a CDN that has nothing to do with your Node.js app and your session collection should stay much healthier\r\n"},"comment":{"url":"https://api.github.com/repos/meanjs/mean/issues/comments/165424024","html_url":"https://github.com/meanjs/mean/issues/1109#issuecomment-165424024","issue_url":"https://api.github.com/repos/meanjs/mean/issues/1109","id":165424024,"user":{"login":"sparshy","id":8553391,"avatar_url":"https://avatars.githubusercontent.com/u/8553391?v=3","gravatar_id":"","url":"https://api.github.com/users/sparshy","html_url":"https://github.com/sparshy","followers_url":"https://api.github.com/users/sparshy/followers","following_url":"https://api.github.com/users/sparshy/following{/other_user}","gists_url":"https://api.github.com/users/sparshy/gists{/gist_id}","starred_url":"https://api.github.com/users/sparshy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparshy/subscriptions","organizations_url":"https://api.github.com/users/sparshy/orgs","repos_url":"https://api.github.com/users/sparshy/repos","events_url":"https://api.github.com/users/sparshy/events{/privacy}","received_events_url":"https://api.github.com/users/sparshy/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T11:06:29Z","updated_at":"2015-12-17T11:06:29Z","body":"My bad I had older version of meanjs"}}