OptiCache

plugin banner

Comprehensive performance optimization: page caching, cache warmup, CSS/JS minification, defer/async loading, and intelligent .htaccess management.

Author:artiosmedia (profile at wordpress.org)
WordPress version required:5.8
WordPress version tested:6.9.4
Plugin version:1.0.9
Added to WordPress repository:31-01-2026
Last updated:12-02-2026
Rating, %:0
Rated by:0
Plugin URI:https://wordpress.org/plugins/search/opticach...
Total downloads:435
Active installs:20+
plugin download
Click to start download

Finally, an all-in-one solution that replaces multiple performance and caching plugins, preconfigured for most users at installation.

OptiCache consolidates the functionality of five or six separate plugins into one lightweight package: page caching, asset minification, lazy loading, security headers, PHP OPcache management, and object caching (Redis/Memcached). Instead of juggling multiple plugins with overlapping features and potential conflicts, OptiCache provides a unified solution with a single settings interface.

The standout feature is the intelligently generated .htaccess optimization. Most cache plugins either ignore .htaccess entirely or offer basic toggles. OptiCache generates comprehensive server rules for GZIP compression, browser caching, security headers, and file protection, while intelligently preserving existing configurations like PHP handlers and cPanel directives. Rules can be edited directly in the admin panel, and toggling any rule off and then back on restores its optimized default.

In testing, a 5.4MB WordPress page with 122 requests and over 4MB of images scored a C- after testing four competing optimization plugins. When switching to OptiCache alone in under 5 minutes, the same page achieved a GTmetrix Grade A with 93% Performance, 1.2s Largest Contentful Paint, and sub-second First Contentful Paint. These results speak for themselves.

Why Site Speed Matters

Slow websites lose visitors. Studies show that 40% of people abandon a website that takes more than 3 seconds to load. Google uses site speed as a ranking factor, meaning faster sites rank higher in search results. A single heavy WordPress site can easily require page caching, asset optimization, lazy loading, server-level compression, and proper cache headers to perform well. Manually configuring .htaccess rules for optimal compression, caching, and security typically requires server administration expertise. OptiCache handles all of this through intelligent automation, producing results that are difficult to achieve with competing solutions.

Preconfigured for Optimal Results

OptiCache activates with safe, effective defaults. No configuration is required for immediate performance gains. The default settings include page caching, HTML/CSS/JS minification, deferred JavaScript loading, GZIP compression, browser caching with optimized expiry times, and security headers. These techniques work safely with virtually any theme or plugin combination. Advanced options, such as CSS/JS combining, which can break load-order-dependent scripts, remain disabled until explicitly enabled. Tooltips throughout the settings panel provide clear explanations and warnings about potential issues if settings are implemented incorrectly.

Key Features:

  • Page Caching – When a visitor loads a page, WordPress normally runs PHP code and database queries to build it. Page caching saves a static HTML copy of each page, so repeat visitors receive the pre-built version instantly with no waiting for PHP or database. This alone can make a site dramatically faster. When content is edited, OptiCache intelligently clears only the affected pages (the post itself, homepage, and relevant archives) rather than purging the entire cache.

  • Database Optimization – WordPress databases accumulate bloat over time: post revisions, auto-drafts, trashed content, spam comments, expired transients, and orphaned metadata. OptiCache provides one-click cleanup for all of these, plus MySQL table optimization. Automatic scheduled cleanup is included as an option for hands-off maintenance.

  • Cache Warmup (Preload) – After the cache is cleared, the first visitor to each page must wait while WordPress rebuilds it. Cache warmup solves this by automatically visiting all pages in the background, pre-building the cache so real visitors always receive fast, cached pages. Includes sitemap discovery that auto-detects XML sitemaps from popular SEO plugins (Yoast, Rank Math, AIOSEO, SEOPress, and more) to ensure all indexed URLs are preloaded.

  • CSS Optimization – Themes and plugins load CSS files that control how the site looks. Minification removes unnecessary spaces and comments from these files, making them smaller and faster to download. An optional combination merges multiple CSS files into one, reducing the number of requests browsers make.

  • JavaScript Optimization – Similar to CSS, but for scripts that add interactivity to the site. Minification shrinks file sizes. Defer loading instructs browsers to load JavaScript after the visible content, so visitors see the page faster. These are premium features in most cache plugins.

  • HTML Minification – Removes unnecessary whitespace, line breaks, and comments from page HTML code, reducing file size by 10-20%.

  • Lazy Loading – Defers loading of images and iframes until they scroll into view, dramatically improving initial page load times. Choose between JavaScript mode with smooth fade-in animation (adjustable speed from 0.4s to 1.0s) or native browser mode for simplicity. The first few images are automatically excluded to prevent affecting the Largest Contentful Paint (LCP) score.

  • Disable Emoji – WordPress loads emoji scripts on every page even though modern browsers display emojis natively. Disabling this removes 2 unnecessary files (~10KB) from every page load.

  • .htaccess Optimization – Intelligently generated server rules that would typically require expert knowledge to configure manually. Toggle controls include HTTPS redirection, WordPress rewrite rules for permalinks, security headers (HSTS, X-Frame-Options, X-Content-Type-Options, XSS Protection, Referrer Policy), GZIP compression, browser caching with optimized expiry times, WebP/AVIF image serving, protection of sensitive files, bad bot blocking, and XML-RPC blocking. Security essentials like author enumeration prevention, registration spam blocking, and directory browsing protection are always active. The intelligent parser preserves existing server configurations such as PHP settings and cPanel handlers when generating new rules.

  • PHP OPcache Management – PHP OPcache is a server feature that remembers compiled PHP code so it doesn’t have to be processed repeatedly. OptiCache displays OPcache statistics and provides one-click clearing when needed (such as after updates).

  • Object Cache (Redis/Memcached) – Object caching stores database query results in memory, dramatically speeding up dynamic pages and WordPress admin areas. This straightforward implementation supports single-server PhpRedis (PECL) and Memcached (PECL) backends, the standard configuration for shared hosting, VPS, and dedicated servers. Automatically detects available extensions and connects to the local cache server. Especially beneficial for WooCommerce stores, membership sites, and any site with logged-in users where page caching doesn’t apply. Simply add server connection details to wp-config.php and enable with one click. (Note: This is not designed for advanced multi-server configurations like Redis Sentinel, clustering, or replication. For those enterprise setups, consider a dedicated object cache plugin.)

  • Resource Preloading – DNS prefetch and preconnect instruct browsers to start connecting to external services (like Google Fonts) before they’re needed, shaving milliseconds off load times.

  • Automatic Plugin Detection – JavaScript optimization (defer, delay, minification) can break scripts that expect to run immediately. OptiCache automatically detects installed e-commerce platforms (WooCommerce, Easy Digital Downloads, MemberPress, BigCommerce, Ecwid), payment gateways (Stripe, PayPal, Square, WooPayments, Authorize.Net, Amazon Pay, Mollie, eWAY, PayFast, Braintree), and common plugins (Contact Form 7, Gravity Forms, Elementor, WPForms), then injects the necessary JavaScript exclusions to protect their critical scripts. When a new plugin or gateway is detected, a notification prompts users to review their JavaScript settings. Exclusions are automatically removed if the plugin is uninstalled. Universal patterns for Google Analytics, Tag Manager, and reCAPTCHA are included by default because they are common across most sites and can cause delays.

  • CDN Integration (Beta) – Serve static assets (images, CSS, JavaScript) from a Content Delivery Network for faster global delivery. Supports all major CDN providers, including Cloudflare, Amazon CloudFront, Akamai, KeyCDN, BunnyCDN, Azure CDN, CDN77, and Google Cloud CDN. Includes Cloudflare API integration for automatic cache purging when content changes, with manual purge available from the admin bar. Configure exclusion patterns for files that should not be served from CDN. Also includes Varnish Integration for hosts using Varnish reverse proxy cache (Cloudways, Kinsta, WP Engine, etc.) with auto-detection, automatic purging on content changes, and connection testing.

  • Admin Toolbar Quick Access – Clear the cache with one click from the WordPress admin bar on any page.

  • Conflict Detection – Automatically detects over 30 caching and optimization plugins including WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache, WP Fastest Cache, Autoptimize, and Perfmatters, identifying specific feature overlaps and providing remediation guidance. Also detects performance features in 14 popular themes including Avada, Divi, BeTheme, The7, Salient, Customizr, X Theme/Pro (Themeco), Astra, GeneratePress, Kadence, Blocksy, OceanWP, Neve, and Hello Elementor. Hosting-level caching from WP Engine, Kinsta, SiteGround, and Cloudflare is also identified.

  • JavaScript Debug Mode – When script optimization causes issues, most users don’t know how to access browser developer tools. OptiCache includes an optional debug mode that captures front-end JavaScript errors and displays them in the admin panel. Enable it temporarily for troubleshooting. The intelligent integration will scan your website, and any errors will appear in a readable table that shows the error message, source file, and affected page. Errors can be purged with one click when finished.

  • WP-CLI Support – Developers and hosting companies can manage cache through command-line scripts for automated deployments and maintenance.

WP-CLI Commands:

  • wp opticache clear – Clear all caches
  • wp opticache clear --type=page – Clear only page cache
  • wp opticache clear --type=assets – Clear only minified CSS/JS
  • wp opticache clear --type=opcache – Clear PHP OPcache
  • wp opticache clear-post 123 – Clear cache for specific post(s)
  • wp opticache stats – Display cache statistics
  • wp opticache preload – Start cache warmup
  • wp opticache preload-stop – Stop cache warmup
  • wp opticache preload-status – Check warmup progress
  • wp opticache htaccess – Install .htaccess rules
  • wp opticache htaccess --action=remove – Remove .htaccess rules
  • wp opticache object status – Show object cache status
  • wp opticache object enable – Enable object cache drop-in
  • wp opticache object disable – Disable object cache drop-in
  • wp opticache object flush – Flush object cache
  • wp opticache object test – Test connection to cache server

Optional Features (Off by Default):

Some features are disabled by default because they require specific configurations or may not be appropriate for all sites:

  • HTTPS Redirect – Enable only with SSL is working. Risk: Makes the site inaccessible without a valid SSL.
  • Block XML-RPC – Risk: Breaks Jetpack and WordPress mobile app.
  • Block SEO Bots – Risk: Blocks Ahrefs, SEMrush, Moz crawlers that may be part of paid subscriptions.
  • WebP/AVIF Support – Does nothing unless next-gen image files have already been created.
  • Combine CSS – Risk: Can break page layouts with load-order dependent stylesheets.
  • Combine JS – Risk: Can break sliders, forms, popups, and payment gateways.

Translations

All 552 text strings use WordPress translation functions. Includes complete translations for English, Spanish, French, German, Russian, Dutch, Polish, Portuguese, and Finnish. Any edits to the PO files or additional languages are welcome.

Donations

If this effort helps you, please consider making a small donation via the main plugin page in the lower-right. All funds support orphans worldwide, especially those in need of survival assistance. This is the sole reason this plugin exists: to help others in desperate need.

Privacy & Data

Operates entirely on your server with no external services, APIs, or data transmission. All cached files and minified assets are stored locally in your wp-content directory. No visitor data is collected, tracked, or shared. No cookies are set except for standard WordPress cookies used to detect logged-in users (to serve uncached pages). The plugin reads your site’s public URLs for cache warmup but makes no external requests. PHP OPcache statistics are read-only from your server’s memory. Complete cache deletion is available via the settings page, the admin bar, or WP-CLI.


Screenshots
FAQ
ChangeLog