5 ms·
I tried this last year for a Wordpress blog with ~1000 articles, and the time to generate the static pages was too long (several minutes) even for routine tasks
by cmdr2 7y ago
I tried this last year for a Wordpress blog with ~1000 articles, and the time to generate the static pages was too long (several minutes) even for routine tasks like adding a new article. Simple things like a "New Articles" list in the sidebar can cause all pages to regenerate. I tried many different approaches (recursive wget, wordpress plugins, intercept wordpress output in PHP with ob_start() etc).
Ultimately, putting a Varnish cache seemed like the only logical answer to speed things a bit more, but that didn't avoid Wordpress security attacks.
For fun though, I built an experimental wordpress-clone dashboard that saved Hugo-compatible files instead, so I wouldn't miss Wordpress' editing features. The result was superb (<5 seconds to regenerate the ~1000 articles blog), but I missed the Wordpress plugins too much to switch to Hugo entirely.
But I still agree with you: "keep wordpress' editing experience, but generate static sites" is a pretty promising direction IMO.
- folkhack 7y agoI've been thinking about doing the same myself but with a direct tie-in from Node.js to MySQL to grab the post objects via mysql2... did you ping the WP JSON API for generating posts? I'm just confused as to how that would break things unless there's a serious bottleneck somewhere.
- ScottFree 7y ago> I missed the Wordpress plugins too much to switch to Hugo entirely. Do you mind if I ask which plugins? Also, if you're missing plugins, it sounds like keeping the wordpress editing experience alone isn't going to be enough. The question then becomes, are you missing plugins themselves or what those specific plugins do for you that doesn't appear to be available in hugo.
- yurishimo 7y agoAs someone who does a lot of WP at their day job and has looked into other platforms, plugins like Gravity Forms are indispensable. It is nearly feature complete at this point and I have full access to the underlying code for any customizations in logic or design. Some hosted form solutions offer features like basic e-commerce which is useful, but then doing something after a submission is almost impossible or everything is in an iframe so customization is limited. If someone could port gravity forms to Craft, I would likely switch all new projects before the end of this year.
- ivanhoe 7y agoI imagine New Articles list would trigger all pages regeneration in any static setup, WP or not?
- cmdr2 7y agoYes it would. But pure static generation tools like Hugo are really fast. In my case, it was regenerating ~1000 articles in about a second, while doing it with wordpress was nearly 25 minutes.