2 ms·
Ask HN: Can you use apache cache for templating engine?
For a while I built websites by copying the same files/folders into directories... seems pretty wasteful for example if every page uses the same layout.
Now it occurs to me I can echo out MySQL data that has the website itself in there as text. But even that is slow, I think it could be as long as 300ms, I should test it... I was looking at this briefly watching the network console tab in Chrome.
I am somewhat aware of templating engines like Twig. I know I'm working with ancient tech regarding LAMP.
I have not touched webpack/node yet.
I was just starting to read up on Apache's cache and I was wondering if this was a dead end/not the right way to go. I saw that you could load files something about "stale"...
My question doesn't really make sense because you still have to inject the content. My one attempt regarding PHP/MySQL echo was to concatenate the parts like: head-section + body/modular + close document. It works, though I have to see how fast/if it's better. It is better in not having redundant code.
- ge96 10y agoI'm also trying to get over my stubbornness. I have mixed feelings with adopting every new technology that comes along seeing as many come out quite frequently. There's the learning curve/brief slow down in productivity like trying to learn Vim. Still I'm starting to see the flaws in my ways especially with being inefficient/slow to deliver. Hence not being employed in this field full time. Anyway, I'll find out I guess. At the time I'm not deploying large scale or anything this is mostly for myself. I'm still based on a cheap single-core VPS with domain-mapping.