Hacker News new | ask | show | jobs
by wjohnsto 1713 days ago
It's important to know that WordPress can be used as a headless CMS. There is active work in that area with plugins like WPGraphQL[0] and frontend frameworks like Faust.js[1]. So you don't _need_ to leave WordPress in order to use some of the tools and gain the scaling benefits of JAMstack.

[0] https://www.wpgraphql.com/ [1] https://faustjs.org/

4 comments

There's another approach which works surprisingly well: If you use Nginx and PHP FPM you can utilize Nginx FastCGI cache [1] to cache dynamic contents. That even allows serving a stale version of an asset while fetching an up-to-date version in the background, avoiding the occasional slow requests for expired items.

With such a cache enabled Wordpress sites feel like they're static pages, while they still offer all features Wordpress offers.

Here is an example for a tutorial on how to configure that for Wordpress: https://easyengine.io/wordpress-nginx/tutorials/single-site/...

[1]: https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#...

I don't disagree. There's lots of options for the content part. I guess the thing I was trying to point out here was that I didn't need a CMS. The content is static, the site is basically a brochure. I was happy just writing static HTML.
It doesn't even have to be this hard -- just be familiar with how the WordPress database lays out its custom post types.

I wrote a Jekyll Generator plugin that just makes a SQL query to the WordPress database and generates all of the sites' content a good 5 or 6 years ago. It's fairly trivial work.

You're right and your approach works well for all the mostly static content. The tools above are useful if you want to enable things like authentication/gated content, e-commerce etc while also having some static content.
WP also has an HTTP-speaking API, but yeah, I've done the "extract posts and pages directly from the DB" thing too. It's maybe half a day if you've never looked at the WP DB schema before, mainly figuring out which tables & fields you need to look at to select only published items. Probably minutes if you're already familiar with it.
entirely agree with you. Problem is I didn’t need a CMS. I was using Wordpress as a design tool.