fvsch / kirby-staticbuilder

Static HTML exporter for Kirby CMS (v2 only)
MIT License
112 stars 8 forks source link

Mixing static + PHP #6

Closed fvsch closed 8 years ago

fvsch commented 8 years ago

From: https://forum.getkirby.com/t/staticbuilder-kirby-as-a-static-site-generator/4084/2

A question I often see raised is: how can I mix static and dynamic content? Because not every site can be 100% static. Going full static brings lots of constraints, a lot of convenient Kirby features can no longer be used. Displaying 3 random items? Easy with Kirby, but once it's exported to static pages it won't be random anymore. Search engine, lists with filters, there are way to do them, but it's a lot of work. I wonder if there is a smart way to statify only some pages, while keeping others handled by Kirby.

fvsch commented 8 years ago

I’m not sure there is any point in doing that:

  1. You would still need to deploy the full Kirby code to production (kirby and site folders at least), so it doesn’t make things more lightweight for deployment or lessens the technical requirements.
  2. Kirby’s cache may be a tiny bit slower, but not by much. So the performance gain would be limited, even for the static pages.
  3. If your web server / virtual host / .htaccess config is broken, the static HTML files won’t be served either, so it doesn’t help with that.

I can see it helping if you want to serve a 99% static website, and have just one or two routes that are dynamic. Then you could write a .htaccess that calls Kirby’s index.php for very specific routes.

If someone wants to suggest a convention — more than the exact implementation — that could make it work and be easy enough to understand for Kirby users, I might consider it.

malvese commented 8 years ago

Yes my question was a bit silly. The cache is almost as fast and should make no noticeable difference for visitors in most cases.

fvsch commented 8 years ago

Closing since I’m not really interested in doing that in the future, and I’d like to only keep the "yes" or "maybe" issues open.