From 6009cb451ed0a42ab1c3e01e9e10a77cb8cbe8f0 Mon Sep 17 00:00:00 2001 From: Ruben Date: Mon, 3 Nov 2025 21:50:43 +0100 Subject: [PATCH] Add markdown file caching functionality Add cache.php with get/set functions for markdown content Update rendering to check cache before processing files --- app/cache.php | 27 +++++++++++++++++++++++++++ app/rendering.php | 15 ++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 app/cache.php diff --git a/app/cache.php b/app/cache.php new file mode 100644 index 0000000..69eee48 --- /dev/null +++ b/app/cache.php @@ -0,0 +1,27 @@ +' . (new Parsedown())->text(file_get_contents($filePath)) . ''; + setCachedMarkdown($filePath, $html); + echo $html; } - echo '
' . (new Parsedown())->text(file_get_contents($filePath)) . '
'; } elseif (in_array($ext, ['html', 'php'])) { include $filePath; }