stakx-io / stakx

An opinionated, powerful, and simple static website generator built in PHP
https://stakx.io/
MIT License
14 stars 3 forks source link

Don't store file content in memory #83

Open allejo opened 5 years ago

allejo commented 5 years ago

Whenever the file is read in as a FrontMatterDocument, the file's contents are stored in memory as $this->bodyContent. The more files that are parsed, the more that is being stored.

I want to explore changing this behavior to reading in the body of the files only when the DevServer needs it; the FrontMatter will still be read in and stored but the body will be thrown away until it's needed again.

For a regular build, however, the Compiler should store things in memory for faster performance.

allejo commented 5 years ago

Since this is likely going to be a very invasive change with how stakx core works and we're in a feature freeze for 0.2.0. I'll move this to the next major release.