How about:
RewriteEngine On
# Match requests like /?node_id=12345
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^node_id=([0-9]+)$
# Skip if the cookie header contains userpass=
RewriteCond %{HTTP_COOKIE} !(^|;\s*)userpass=
# Serve cached file if it exists
RewriteCond %{DOCUMENT_ROOT}/cache/%1.html -f
RewriteRule ^$ /cache/%1.html [L]
Then any time anonymous requests a page, save a copy of what you serve to /cache/$node_id.html, and every time someone posts/edits content under a node, call unlink("cache/$node_id.html");
Apache should be able to crank these out way faster than CGI could.
For bonus points, store the cache in ZFS with compression enabled. Maybe also minify the HTML before saving it.