I am using a very simple template system to avoid having to work through super long html pages using "php include" as in the following:
For example, in my index.php file...
<!doctype html>
<html lang="en">
<?php include 'head.php'; ?>
<body>
<div>
<header><?php include 'nav.php'; ?></header>
<main>
<?php include 'article1.php'; ?>
<?php include 'article2.php'; ?>
<?php include 'article3.php'; ?>
</main>
<footer><?php include 'footer.php'; ?></footer>
</body>
</html>
The php components themselves (e.g., nav.php) are html files. In some cases these components, such as the footer.php will be duplicated in every main page. Is there an easy way to cache the main pages and/or their components (e.g., automatically generate static pages) on the server.
This looks hopeful, https://dzone.com/articles/how-to-create-a-simple-and-efficient-php-cache . Should I even be concern about caching? I know very little about php. I welcome your suggestions. Thanks