Hacker News new | ask | show | jobs
by jacooper 1330 days ago
I am waiting for the time where we can host WordPress freely with static hosting and workers for admin ui/dynamic content.

Otherwise static websites are only for devs.

5 comments

They have a product for that https://www.cloudflare.com/pg-lp/speed-up-wordpress-with-clo... It caches all pages on Cloudflare and only bypasses Cache on Cookies such as `wp-.|wordpress.|comment_.|wordpress_logged_.` which is used by /wp-admin/ are and when someone posts a comment. This turns your WP into static without doing anything special. Or you can write a custom cache rule for cookies using "Page Rules" or newly introduced "Cache Rules" beta https://developers.cloudflare.com/cache/about/cache-rules/

Also check - a WordPress plugin for static site generation and deployment https://github.com/WP2Static/wp2static

I used wp2static to archive a WordPress site recently, and I am disappointed with the performance.

The same website without Cloudflare CDN and just using a simple caching plugin is much faster than the exported version by wp2static hosted on Cloudflare pages.

It has fallen from 99 to 78 in the mobile page speed test.

I tried creating a copy of the website using wget, it was faster but i faced issues with missing files and posts on the main page using temporary query links and not the permanent links.

So I went through the Hassle of compiling wp2static and just eating the performance loss instead.

This would require you to host WordPress somewhere.

If you can host it on workers for example, you can get an entirety free, managed website just with one click(obviously someone would do a template to enable you to setup wp on cf pages if that was possible).

This.

I keep seeing these 'JAMstack' sites are the new hot thing when a static wordpress site is enough and easier to update than 'JAMstack' sites, in reality these sites are just glorified HTML under a CDN.

I don't see the benefit of JAMstack when you can just place a static WP site under a CDN like Cloudflare and have all the benefits of WP and a CMS to edit content.

At least with Cloudflare they are more than just a CDN, others like Netlify and Vercel seem to be both over engineered and overpriced for what they do.

They solve different problems. WordPress is a full stack solution that's great for blogs and simple websites. The downside is that it's a lot of maintenance (requiring a LEMP stack) and not very portable. You have to copy over everything from the code to the database to the files to things like htaccess and nginx config. Hosts Like Pantheon and wpengine make that easier, but you're still bogged down by overhead. Scaling is really hard if mere caching doesn't work because you have to deal with Mysql replication and slaving. And what's really annoying about this setup is that you HAVE to deal with the whole stack. If the content writers want to preview their changes, you have to a clone them a staging environment. That means DB merges or overrides. And if you're simultaneously making other changes to the production DB, good luck reconciling the two.

Jamstacks really shine when you can decouple the frontend from the backend(s), because then you have an easily replicable single repo with nothing but code. You can deploy it to any Jamstack host with a push and they handle all of the scaling and https and caching concerns. And the backend teams, whether an in house endpoint or content writers working on a hosted headless CMS, never have to care about the stack.

A middle ground that's interesting to explore is using WordPress with Advanced Custom Forms as a backend plus a Jamstack frontend. ACF is still quite a bit more powerful than any of the headless CMS solutions I've tried, but it does mean you still have to maintain a LEMP stack, which is a headache in and of itself.

As much as I dislike it personally, WordPress’s admin portal and plugins like ACF (among others) are simply unbeatable when the end result is handing the keys over a client, both due to power and familiarity.

I wonder if that will change given enough time. I certainly hope so, but I would’ve guessed that it would’ve changed already, but here we are in 2022…

Static WordPress is possible - you can generate a static replica of your WordPress site and deploy that via CDN. There are some plugins that help you do that (Simply Static, WP2Static) but you need to also configure your whole infrastructure when using them, and the build process can be long and painful.

There are also managed services for doing this that take care of everything for you, from the WP hosting env, to the static hosting and CDN, along with replicating certain types of dynamic functionality on the static site like forms and search.

One example of this type of managed static WordPress hosting service is Strattic: https://www.strattic.com.

Have you seen Strattic? It's a static hosting service for standard WordPress sites (i.e. monolithic WordPress as opposed to headless WordPress), so the time has arrived (unless you meant "freely" as in "free beer" and not "without limitation). https://www.strattic.com
I've successfully run WordPress with the simply-static plugin, and a script to send to static hosting. WP run on an arm64 instance that was only started when editing was needed.

Besides WP, there are static CMSes that fit a modern workflow perfectly.

> I've successfully run WordPress with the simply-static plugin, and a script to send to static hosting.

Interesting, simply-static never worked for me, only wp2static did and it had a lot of bugs.

> WP run on an arm64 instance that was only started when editing was needed.

How do you do this?, are you doing some kind of webserver container run trigger? Or running it on a managed platform?

> Besides WP, there are static CMSes that fit a modern workflow perfectly.

Yeah but they aren't so customizable and flexible like WordPress, the goal is to be able to create a whole static site without needing to write anything manually.

Yeah, I have a few WordPress sites that would be great to move to SQLite (durable objects) / workers+functions.

My sense is it's still a ways out from being practical, though.