Flat-file / DB Improvement
Posted: Sat Aug 02, 2025 2:14 pm
Currenlty, the 'pages.php' holds most metadata for all content. That has a number of disadvanages:
1. reliance on admin panel to add content (loosing the big advantage of flat-file cms that you can add content just by ftp)
2. if that file gets corrupt, so is the database;
3. if multiple customers add or change pages, you may hit race conditions;
4. if you have a large number of pages, this file keeps on growing (and likely becomes slower);
A cleaner solution is to use 'frontmatter' in the content directories (either in the content file or as a small file next to index.txt). That is also how other flat-file CMS's solve this (GravCMS, Pico, ..) and proven method.
The (interface of) pages.php could still remain so impact is limited, letting the implementation deal with reading and writing front-matter.
1. reliance on admin panel to add content (loosing the big advantage of flat-file cms that you can add content just by ftp)
2. if that file gets corrupt, so is the database;
3. if multiple customers add or change pages, you may hit race conditions;
4. if you have a large number of pages, this file keeps on growing (and likely becomes slower);
A cleaner solution is to use 'frontmatter' in the content directories (either in the content file or as a small file next to index.txt). That is also how other flat-file CMS's solve this (GravCMS, Pico, ..) and proven method.
The (interface of) pages.php could still remain so impact is limited, letting the implementation deal with reading and writing front-matter.