4 ms·
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 li
by wjohnsto 5y 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/ https://www.wpgraphql.com/
[1] https://faustjs.org/ https://faustjs.org/
- busterarm 5y agoIt 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.
- wjohnsto 5y agoYou'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.
- handrous 5y agoWP 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.
- ridings 5y agoI 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.
- Dunedan 5y agoThere'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/fastcgi-cache-with-purging/ https://easyengine.io/wordpress-nginx/tutorials/single-site/... [1]: https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_cache https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#...
- ridings 5y agoentirely agree with you. Problem is I didn’t need a CMS. I was using Wordpress as a design tool.