Serve Static – Automatic WordPress Static Page generator
Serve Static provides a very efficient, simple and fast way of implementing static page caching in WordPress. It will generate static HTML copies of your webpages which will be then served using your server rewrite rules. This feature will bypass the whole PHP process and render only a simple HTML file without having to interect with the PHP, or MySQL for getting your page’s design or content. This plugin is really handy and helpful if your webpages are mainly static, like websites of Blogs, portfolios, company portfolios, service, and many more. This plugin doesn’t support any dynamic content caching, that means, all none of your dynamic content will be showing in the frontend, rather, a static version of that content will be showing. This plugin also comes with home-made HTML, CSS and JS minification features, which you can use to auto-minify the static files. This ensures more lightness of the HTML pages, and more boost to your page speed. Also, you can auto-warm the cache using the Warm feature, which will stimulate a visit on all your pages, to create the static files before they are served to your visitors. Usage After activating the plugin, it will try to modify your .htaccess file. If this is not possible for some reason, make sure to enter the rules by yourself. NOTE: without these .htaccess rules, the static files won’t be served or created. Note that, this is only applicable if you are using a Apache/Litespeed server. # BEGIN Serve Static Cache RewriteEngine On RewriteBase / RewriteCond %{HTTP_COOKIE} !(^|;\s*)wordpress_logged_in_.*$ [NC] RewriteCond %{REQUEST_URI} !^/(elementor|vc_row|fl_builder|fl-theme-builder) [NC] RewriteCond %{REQUEST_URI} !^/wp-admin/ [NC] RewriteCond %{REQUEST_METHOD} GET RewriteCond %{QUERY_STRING} ^$ [NC] RewriteCond %{DOCUMENT_ROOT}/wp-content/serve-static-cache/$1/index.html -f RewriteRule ^(.*)$ /wp-content/serve-static-cache/$1/index.html [L] # END Serve Static Cache If you the website installed on a sub-folder, like such that “https://test.com/domain1”, is your main domain of your WordPress site, you need to use a different .htaccess code. The plugin will automatically do that for you, but incase you need to do it manually, below is the format you need to follow. # BEGIN Serve Static Cache RewriteEngine On RewriteBase / RewriteCond %{HTTP_COOKIE} !(^|;\s*)wordpress_logged_in_.*$ [NC] RewriteCond %{REQUEST_URI} !^/(elementor|vc_row|fl_builder|fl-theme-builder) [NC] RewriteCond %{REQUEST_URI} !^/wp-admin/ [NC] RewriteCond %{REQUEST_METHOD} GET RewriteCond %{QUERY_STRING} ^$ [NC] RewriteCond "WP_CONTENT_DIR"/serve-static-cache/"sub-folder domain without slashes"/$1/index.html -f RewriteRule ^(.*)$ /"sub-folder domain without slashes"/wp-content/serve-static-cache/"sub-folder domain without slashes"/$1/index.html [L] # END Serve Static Cache The value of the WP_CONTENT_DIR should be something like: “/home/test.com/public_html/staging/wp-content” The value of the “sub-folder domain without slashes” should be your folder where WordPress is installed. So, if the WordPress is installed in “https://test.com/staging”, you should enter “staging”. When using a nginx server, make sure to add the following rules: # BEGIN Serve Static Cache location / { if ($http_cookie !~* "wordpress_logged_in_") { set $cache_uri $request_uri; if ($request_uri ~* "^/(elementor|vc_row|fl_builder|fl-theme-builder)") { set $cache_uri "null cache"; } if ($request_uri ~* "^/wp-admin/") { set $cache_uri "null cache"; } if ($request_method = GET) { set $cache_uri "null cache"; } if (-f $document_root/wp-content/serve-static-cache$cache_uri/index.html) { set $cache_file $document_root/wp-content/serve-static-cache$cache_uri/index.html; } if ($cache_file) { rewrite ^ /wp-content/serve-static-cache$cache_uri/index.html break; } } } # END Serve Static Cache This plugin creates static HTML versions of your pages/posts, or literally any custom post types, and serves them to your non-logged-in visitors. This is an awesome way to make your website blazing fast, and not even one request is made to PHP to request your pages. Anytime a Static page/post/any custom post type is updated, the cache of that specific page is automatically cleared, and regenerated. So, you do not have to worry about regenerating the cache eac time after making changes to your content. This plugin is also well-integrated with frontend post rating plugins as well, so that when any rating is added, the cache gets regenerated automatically. If you are using any rating plugins that are not working with this plugin, kindly let me know in the support forum. This plugin heavily relies on CRON to process it’s functionalities. So please make sure either your server-level cron or WordPress Cron is running and working. If not, this plugin will show errors in the Admin Notices to help you direct to the problem. If there are still many issues, kindly share in the plugin support thread. By default, this plugin automatically works with Apache and Litespeed servers, and everywhere .htaccess rules is functional. But to make this plugin work with NGINX, you will be needing to add some rules to your nginx.conf or site.conf file. An appropiate admin notice will be shown to you accordingly, kindly follow those instructions. This plugin is supposed to work with all the form builder plugins like WP Forms, Ninja Forms. If you face any issues while using any form plugin, kindly let me know in the thread, and I will try to make it compitable. Performance Converting your website to a static webpage can drastically improve your performance and page speed. Serve Static eliminates all requests made to your database and ultimately reducing the first time to byte, total blocking time and many more. This is especially impactful for websites that have mainly static pages, and use long pages with a lot of graphs, sliders, and other load-heavy resources like animations. Reduce hosting bandwidth Using Serve Static to serve static HTML pages of your website really cuts a great cost in your bandwidth usage, as this doesn’t hit the MySQL server for your visitors, but instead serves delivers a cached, minified HTML copy. This releases much of your cost, alongside the page boost. We are working on features like “hosting your Static pages in a third party CDN, and serving those to your visitors”. If you are interested to see this feature in soon, let me know by opening a supprt thread! NOTE Caching is fully disabled for Administrators, or any logged-in users. Static Cache will only be served to logged-out visitors of your site. Note that, the Static Cache can only be regenerated by using the buttons in the admin toolbar, or in the Settings page. After the cache is Flushed, the cache is NOT regenerated when someone visits the pages. This is done so that none of the personalized content gets saved in the HTML caches. This plugin may not work as expected with a caching plugin like WP Rocket or W3 Total Cache. So make sure the URLs of the static pages are excluded from the specific plugins. For example, when using WP Rocket, you need to navigate under Settings > WP Rocket > Advanced Rules > Never Cache URLs, and enter the URLs to the pages you want to serve as Static. When using W3 Total Cache, navigate under Performance > Page cache > Advanced > Never cache the following pages.
Top keywords
- cache31×2.63%
- static26×2.20%
- html16×1.36%
- uri14×1.19%
- pages12×1.02%
- request12×1.02%
- rewritecond12×1.02%
- serve11×0.93%
- serve static10×0.85%
- page9×0.76%
- content8×0.68%
- nc8×0.68%
DietPress
DietPress is a free WordPress speed optimization plugin with a built-in page cache. Page caching, browser caching, GZIP and Brotli compression, deferred JavaScript, critical CSS, image loading attributes, preloading, locally hosted Google Fonts and selective asset loading, all in one plugin and all free. And it goes further than a caching plugin: it also puts WordPress itself on a diet, switching off the features your site never uses. It pairs that with a clean, risk-based interface. Everything is configurable, the optimizations are already on by default, and nothing is hidden behind a paid tier. Activate it and your site is faster, or open the settings and tune every detail. By default WordPress loads functions, services and scripts that most sites do not need. They slow down loading times and consume hosting resources. DietPress lets you trim that fat and apply battle-tested performance tweaks, with a clear description of what each option does and what might break, organized by risk level so you always know what is safe. WHY CHOOSE DIETPRESS Page caching, for free. Serve anonymous visitors a copy stored on disk instead of building the page again. The feature people buy WP Rocket or a NitroPack subscription for, with no licence and no monthly fee. No drop-in, no changes to wp-config.php. Unlike WP Super Cache or W3 Total Cache, DietPress installs no advanced-cache.php and never edits wp-config.php. Switching it off leaves your site exactly as it was, with nothing orphaned behind. It tells you why. Most cache plugins leave you guessing when nothing is cached. DietPress reports its own status, tests itself against your home page, and names the exact reason a page was skipped. WooCommerce-safe by design. Carts, checkout, my account and any visitor carrying a cart cookie always get the live site, so nobody ever sees somebody else’s basket. Diet as well as speed. Where Perfmatters focuses on disabling scripts, DietPress covers that ground and adds page caching, critical CSS, local Google Fonts and a dashboard, admin and email cleanup, in one plugin. Light on your server. No account, no external service, no telemetry, no upsell nags. Everything runs on your own hosting. WHAT THE PAGE CACHE DOES TO YOUR RESPONSE TIME Measured on a WordPress 7.0 install with GeneratePress, WooCommerce and a 76 product catalogue, PHP 8.5, taking the median of 15 requests per URL. Your own hosting will give different figures, but the shape of the result will not change. Server response time, the same pages with the page cache off and on: Home page – 52.7 ms without, 15.1 ms with, 71% faster WooCommerce shop – 45.4 ms without, 14.8 ms with, 67% faster A 110 KB article – 43.0 ms without, 15.1 ms with, 65% faster A 98 KB page – 41.0 ms without, 14.9 ms with, 64% faster A product category – 41.3 ms without, 15.1 ms with, 63% faster The interesting part is not the percentage, it is that the cached figure barely moves. Serving a stored file costs the same whether the page was cheap or expensive to build, so the saving grows with the size of your site rather than with the power of your server. The heaviest page in the test is the one that gained most. It also changes how much traffic your hosting can take at once. In the same test the server went from serving about 40 visits a second to more than 210, five times as many, on exactly the same plan. That is what keeps a small site standing up when one of your posts does well. TWO THINGS IN ONE PLUGIN 1. Performance optimizations (on by default) Automatic Critical CSS inlined in the head (optional experimental deferral of non-critical CSS) JavaScript defer parsing with smart dependency handling Image loading attributes safety net: lazy loading, decoding=async and fetchpriority for images that bypass core Automatic image dimensions for better CLS scores (including picture elements) Resource hints: preconnect and DNS prefetch for common third-party origins Theme stylesheet, critical fonts and logo preloading for a faster LCP Google Fonts display=swap Google Fonts local hosting: serve the fonts your theme uses from your own server, GDPR-friendly with a silent fallback to the Google CDN (opt-in) Selective third-party loading: WooCommerce, Contact Form 7, block library, Slider Revolution, TablePress, Smash Balloon, Formidable Forms and Everest Forms assets only load where they are used (opt-in) RSS feed optimization (cache headers and item limit) Server rules in .htaccess: browser caching with a configurable lifetime for media, for styles and scripts and for fonts, GZIP and Brotli compression, immutable cache headers, CORS for fonts and keep-alive (master switch plus per-feature toggles) Database maintenance: daily expired-transient cleanup and safe query optimizations Page cache: store each page on disk and serve it to anonymous visitors without building it again, with automatic purging, gzip precompression and a status panel that says whether it is working (opt-in, in its own tab) 2. Put WordPress on a diet (risk-based, opt-in) Light (safe for any site): emojis, RSD/WLW tags, shortlinks, self-pingbacks, comment pagination, and more Moderate (evaluate first): oEmbed, jQuery Migrate, Dashicons on the frontend, Global Styles and Duotone, remote block patterns, avatars and Gravatar, comment threading, and more Strict (site-specific): granular RSS feed control, Heartbeat API mode, post revisions and autosave, disable comments, XML sitemap, native lazy loading/fetchpriority, content types, selective loading for WooCommerce, Contact Form 7, block assets, Slider Revolution, TablePress, Smash Balloon, Formidable Forms and Everest Forms, and more Widgets: dashboard widgets (including third-party ones from Yoast, WooCommerce, Elementor, Jetpack, Wordfence, Rank Math, Gravity Forms), classic sidebar widgets, block-editor widgets and the Customizer Emails: silence the automatic emails WordPress sends on its own, grouped by area: auto-update results for core, plugins and themes (plus the new-version notice), comment moderation and new-comment notices, and new user, password and email-change notices, plus toggles for the admin email verification prompt and post-by-email. Every option is off by default, and critical notices such as a failed core update are always kept SCALE, PROFILES AND ANALYZER Savings indicator: HTTP requests removed, CSS/JS saved and active optimizations at a glance Quick profiles: Personal Blog, WooCommerce Store, Landing Page and Maximum Cleanup Site analyzer: personalized recommendations based on your active plugins and content, page cache included Import and export your whole configuration as a JSON file COMPATIBILITY AND EXTENSIBILITY The plugin includes filters for developers: dietpress_critical_css – Customize the inline critical CSS dietpress_critical_css_handles – Define which CSS handles are critical dietpress_skip_defer_script_handles – Opt scripts out of the JavaScript defer dietpress_skip_defer_style_handles – Opt stylesheets out of the CSS deferral dietpress_preconnect_hints – Customize preconnect origins dietpress_dns_prefetch_domains – Customize DNS prefetch domains dietpress_critical_fonts – Define critical fonts to preload dietpress_exclude_local_fonts – Exclude Google Fonts stylesheets from local hosting dietpress_selective_{module}_has_content – Mark a page as showing the content of a selective loading module, so its assets are kept. The module is wc, cf7, formidable, everest_forms or revslider dietpress_selective_{module}_styles / dietpress_selective_{module}_scripts – Adjust the handles removed by each module dietpress_selective_page_hides_content – Mark a page as rendering content the content scan cannot reach, so no module removes anything (this is what handles Elementor) dietpress_selective_is_wc_page – Override the WooCommerce page detection of selective loading dietpress_selective_wc_keep_cart_fragments – Keep the cart fragments script when your theme has a hand-coded mini-cart dietpress_selective_cf7_has_form – Mark pages that load a Contact Form 7 form dynamically dietpress_selective_blocks_dequeue – Override the block library dequeue decision dietpress_selective_everest_forms_dequeue_dashicons – Keep Dashicons when another plugin enqueues it directly dietpress_native_sitemap_in_use – Tell DietPress your plugin builds on the native WordPress sitemap, so the option that removes it becomes unavailable dietpress_cache_bypass – Keep the current page out of the page cache dietpress_cache_bypass_cookies – Adjust the cookie name prefixes that make a visitor uncacheable dietpress_cache_ignored_params – Adjust the query parameters that do not change the page dietpress_cache_exclude_urls – Adjust the excluded URL patterns dietpress_cache_post_urls – Adjust the URLs purged along with a post Compatible with: Well-coded themes and page builders (Divi, Elementor, Beaver Builder, Bricks Gutenberg) Cache plugins (WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache, etc.). The one exception is the optional page cache module, which will not run beside another page cache and says so; everything else in DietPress works alongside them as it always has Security plugins (DietPress focuses on performance and deliberately leaves security to them; we recommend our free Vigilant) CDNs (Cloudflare, StackPath, KeyCDN, etc.) thanks to CORS and Vary headers WordPress Multisite (except the optional page cache module, which does not support it yet) HOW TO VERIFY THE OPTIMIZATIONS Cache rules: check your .htaccess for a block marked # BEGIN DietPress with immutable Cache-Control headers Logo preload: view page source and look for pointing to your logo Critical CSS: view source and look for in the head Compression: test at giftofspeed.com/gzip-test Always measure with tools like Google PageSpeed, GTMetrix or WebPageTest, and run each test at least twice to account for caching. Support Need private support or custom development? Do you need one-on-one help, priority troubleshooting, or a custom feature, integration, or tweak built specifically for your site? I offer private support and custom development. Just contact me and tell me what you need. Need help or have suggestions? Official website WordPress support forum YouTube channel Documentation and tutorials Love the plugin? Please leave us a 5-star review and help spread the word! About AyudaWP We are specialists in WordPress security, SEO, AI and performance optimization plugins. We create tools that solve real problems for WordPress site owners while maintaining the highest coding standards and accessibility requirements.