Skip to content

Optimise Ghost boot-up #2182

@ErisDS

Description

@ErisDS

This is a bit of a case of me thinking out loud. Perhaps it's part of #1789, but it is also related to #2156 and #2179 (package.json support).

At the moment we have:

  • bootstrap (initialise the config file)
  • server init (does a whole tonne of stuff, finally calling server.listen)
  • serve first request = middleware

I'm wondering if the server init could be streamlined into only things that are absolutely necessary to happen before Ghost even starts.

Surely a whole heap of this isn't actually needed until we serve the first request which needs it. For example, mail - it might never ever be needed, so why bother initialising it before we start Ghost?

Similarly with the new package.json stuff, should we be loading this into config? That's certainly convenient, but should it be somewhere else, loaded only if and when it is necessary? Or should it be passed to config later on in the flow... generated when requested?

This is a pretty different way of working, but I'm thinking it could lead us to much more streamlined, more modular code, it could give us a faster boot time, and a smaller memory footprint by default.

But I am just thinking out loud 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects:serverIssues relating to the server or core of Ghosthelp wanted[triage] Ideal issues for contributors to help with

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions