TryGhost / Ghost

Independent technology for modern publishing, memberships, subscriptions and newsletters.
https://ghost.org
MIT License
47.67k stars 10.4k forks source link

Ghost middleware is registered again and again and again #761

Closed gotdibbs closed 11 years ago

gotdibbs commented 11 years ago

The way that the theme middleware is being registered in server.js through ghost.initTheme(server) is actually causing the app.use and app.set calls to happen every time a request is made to the server. This is causing express' stack to get massively bloated as each one of these handlers is registered over and over again.

app stack

jgable commented 11 years ago

This may be kind of addressed in my grunt client file refactor PR. I noticed that a lot of the things we were doing like setting the view engine and some of th static directories did not need to get done on every request.

ErisDS commented 11 years ago

Yeah this is a big bad bleurgh bug that I wanted to get done as part of he refactor and is also blocking #448

Gonna merge @jgable's work then see where we are