static_node
The Static Node Generator module improves performance by generating and serving static HTML versions of Drupal nodes. It reduces server load and significantly speeds up page load times for users. Ideal for content-heavy websites, it supports manual and bulk static file generation, automatic redirects, asset management, and granular permission control.
Features
- Static HTML Generation: Generate static HTML versions of individual nodes and the homepage.
- Automatic Redirect: Anonymous users are redirected to static pages when available.
- Node Form Integration: Add a "Generate Static Page" button on the node edit form.
- Bulk Actions: Generate or delete static content for multiple nodes from the content listing.
- Asset Management: Automatically includes CSS, JavaScript, images, and other assets.
- File List Page: Admin interface at
/admin/content/static-filesto manage generated static files.
- Permission Control: Fine-grained permissions for generating and deleting static pages.
- Cache Automation: Automatically clears relevant caches when static pages are created or deleted.
- Configurable Static Folder: Choose the destination folder for static files (default:
public://static). - Node Type Control: Enable static generation only for selected node types.
Post-Installation
- Enable the module via
drush en static_node -yor through the UI. - Configure permissions at
/admin/people/permissions:generate static nodedelete static node
- Visit
/admin/config/system/static-nodeto:- Select which node types support static generation
- Set the static files folder path
- Manage generated files via
/admin/content/static-files
Additional Requirements
- Drupal 10 or 11
- PHP 8.0 or higher (recommended)
- Core modules:
node,file
Recommended modules/libraries
No third-party libraries are required. However, using Drush can streamline bulk generation via the command line.
Similar projects
Note: Unlike Tome, this module is not designed to statically export an entire Drupal site. Instead, it focuses on generating static versions of individual pages (nodes) on demand. This makes it perfect for use cases such as launching a campaign landing page expected to receive a sudden spike in traffic, allowing only selected content to be served as static for maximum performance and control—without compromising the rest of the site's dynamic capabilities.
Unlike full-site static generators, Static HTML Node focuses on individual nodes and integrates directly with the Drupal admin UI. It’s ideal for sites that need hybrid dynamic/static content delivery.
Supporting this Module
Maintained by Alberto Cocchiara (bigbabert). Contributions, feedback, and support are welcome via the Drupal project page.
Community Documentation
For usage examples and troubleshooting tips, see the README file and future community resources. Video walkthroughs and demos will be linked here when available.
Static Node Generator for Drupal 11 is built with Gen AI support from GitHub Copilot, using Agent mode with Claude 3.7 Sonnet.