Prime Cache Pro Manual

Prime Cache Manual (Pro Edition)

Version 1.7.30 | PHP 7.4+ | WordPress 5.8+ | Requires Prime Cache (Free) 1.10.20+ installed & active
The Pro edition adds AVIF conversion, Critical CSS / Remove Unused CSS, Delay JS, Cloudflare / Sucuri / Varnish integrations, Persistent Object Cache (APCu / Redis / Memcached), database optimization, YouTube thumbnail replacement, and more on top of every Free feature.
For settings available in the Free version, please refer to the Free Manual. (WebP conversion itself moved into the Free edition in 1.10.0; Pro layers AVIF on top.)

Pro Add-on Model
Prime Cache Pro is an add-on plugin. The Free version of Prime Cache must be installed and activated before Pro features become available. All Free features remain fully functional; Pro extends them with the capabilities documented in this manual. The bundled feature list is also visible inside WordPress at Prime Cache → Pro Features (a dedicated information page introduced in Free 1.10.14).

Getting Started

License Activation

After purchasing a Pro license, you will receive a license key by email. The key format is RPLS-XXXX-XXXX-XXXX-XXXX. Follow the steps below to activate Pro features on your site.

How to Activate:

  1. Make sure the free Prime Cache plugin is installed and activated.
  2. Install the Prime Cache Pro add-on plugin via the WordPress admin panel (Plugins → Add New → Upload Plugin).
  3. Activate Prime Cache Pro.
  4. Go to Prime Cache → License in the WordPress admin menu.
  5. Paste your license key into the License Key field.
  6. Click Activate License.
  7. The status indicator should change to Active. Pro settings will become available immediately.
FieldDescription
License KeyYour RPLS-XXXX-XXXX-XXXX-XXXX key from the purchase confirmation email
License StatusActive / Inactive / Expired
Expiration DateDisplayed after successful activation
Site URLThe domain tied to this license (one license per production domain)
License verification: Activation calls the Rapls Works license API at https://raplsworks.com/wp-content/uploads/ai-chatbot/rpls-license-api.php. Your server must be able to make outbound HTTPS requests. Verify that allow_url_fopen or cURL is enabled if activation fails.
Staging / Development sites: If you need to test Pro on a local or staging environment, deactivate the license on the production site first, then activate on the staging site. Reactivate on production when done.

Server Requirements

Most Pro features work on any standard WordPress hosting environment. Some features have additional requirements:

FeatureRequirement
WebP ConversionPHP GD extension with WebP support, or Imagick
AVIF ConversionPHP Imagick 3.4.4+ with libavif, or GD compiled with AVIF support (PHP 8.1+)
Object Cache (APCu)PHP APCu extension enabled (apc.enabled=1)
Object Cache (Redis)PHP phpredis or predis extension; Redis server reachable
Object Cache (Memcached)PHP Memcached extension; Memcached daemon reachable
.htaccess OptimizationApache with mod_rewrite, mod_expires, mod_deflate enabled
Speculation Rules APIChrome 109+ (non-supporting browsers silently ignore the rules)
Brotli CompressionApache mod_brotli or Nginx ngx_brotli module
Check your environment: Go to Prime Cache → Tools → System Information for a comprehensive report of PHP extensions, GD/Imagick capabilities, server software, and which Pro features are supported on your host.

Quick Start for Pro

After activating your license, the recommended order for enabling Pro features is:

  1. File Optimization tab — Enable Combine CSS, Combine JS, then Delay JavaScript. Test your site after each step.
  2. Critical CSS tab — Click “Generate” to auto-generate above-the-fold CSS. Verify the result visually.
  3. Media tab — Enable WebP conversion, then run Bulk Optimization on existing images.
  4. CDN tab — If you use a CDN, enter the CDN URL and optionally configure Cloudflare API credentials.
  5. Preload tab — Enable cache preloading and link prefetching. Enable Speculation Rules for Chrome.
  6. Object Cache tab — Select APCu, Redis, or Memcached based on your server’s available extensions.
  7. Database tab — Review cleanup items and set an automatic schedule (weekly is a safe default).
Important: CSS/JS combining and Delay JavaScript can break poorly coded themes or plugins. Always test in a staging environment or immediately after enabling each feature. Use the admin bar’s “Purge All Cache” button after any change.

File Optimization (Pro)

Pro unlocks advanced file optimization capabilities that reduce HTTP requests, eliminate render-blocking resources, and dramatically cut page load times. These settings are found under Prime Cache → File Optimization.

Combine CSS

Merges all CSS files enqueued by WordPress into a single stylesheet, reducing the number of HTTP requests the browser must make before rendering the page.

SettingDefaultDescription
Combine CSSDisabledMerge all CSS files into one combined file
Exclude CSS FilesEmptyFile paths or handles to exclude from combining (one per line). Use partial matches.
Inline Small CSSDisabledInline CSS files smaller than the configured threshold directly into <style> tags, eliminating HTTP requests for tiny stylesheets
Inline Threshold2 KBCSS files below this size are inlined rather than combined
Warning: Combining CSS can cause visual breakage if stylesheets depend on load order in unusual ways. Start with exclusions for any stylesheet that breaks, then re-enable combining for the rest. Common exclusions: block editor styles, WooCommerce stylesheets on non-shop pages.

How to Configure:

  1. Go to Prime Cache → File Optimization
  2. Enable Combine CSS
  3. Load your homepage in a private/incognito window to check for visual issues
  4. Add any broken stylesheet paths to the Exclude list
  5. Save settings and purge the cache

Combine JavaScript

Merges all JavaScript files into a single bundle, reducing HTTP requests. Combined with defer, this can dramatically lower Time to Interactive (TTI).

SettingDefaultDescription
Combine JavaScriptDisabledMerge all JS files into one combined file
Exclude JS FilesEmptyPaths or handles to exclude from combining (one per line)
Warning: JavaScript combining is the most likely operation to break site functionality. Test thoroughly on every page template. Scripts that use document.write() cannot be combined. Always exclude inline event handlers and scripts that must remain in <head>.

Defer JavaScript

Adds the defer attribute to script tags, preventing JavaScript from blocking the HTML parser. Deferred scripts execute after the DOM is fully parsed but before DOMContentLoaded.

SettingDefaultDescription
Defer JavaScriptDisabledAdd defer attribute to all script tags
Exclude from DeferEmptyScript handles or paths that should NOT be deferred
jQuery & Defer: When jQuery is deferred, inline scripts that call $() or jQuery() before jQuery loads will throw errors. Prime Cache automatically wraps inline jQuery code in a DOMContentLoaded listener to handle this safely. If you notice jQuery errors after enabling defer, add the offending script to the exclude list.

Delay JavaScript

Delays the loading and execution of all JavaScript until the user interacts with the page (scroll, click, touch, or keypress). This can dramatically improve Largest Contentful Paint (LCP) and First Input Delay (FID) scores, especially on mobile.

SettingDefaultDescription
Delay JavaScriptDisabledDelay all JS execution until first user interaction
Delay JS Safe ModeDisabledOnly delay external (third-party) scripts. Internal scripts run normally. Safer for complex themes.
Delay Timeout5 secondsMaximum time to wait for interaction before loading JS anyway (prevents blank screens on non-interactive sessions)
Exclude from DelayEmptyScript handles or URL fragments that should NOT be delayed
Third-party PresetsEmptyPreset rules for common third-party scripts (Google Tag Manager, Meta Pixel, HubSpot, etc.)
Safe Mode recommendation: Enable Safe Mode first. It delays only external scripts (analytics trackers, social widgets, chat widgets) while keeping your theme’s JavaScript functional. Once you have confirmed there are no issues, you can try disabling Safe Mode to delay all scripts for maximum performance gain.
Separate mobile cache required: Delay JavaScript is most impactful on mobile. To serve a mobile-optimized page with delayed JS to mobile visitors, enable Separate Mobile Cache in the Page Cache settings. Desktop and mobile will then receive independently optimized pages.

Interaction events that trigger JS loading:

  • scroll — page is scrolled
  • click / touchstart — user taps or clicks
  • keydown — any key is pressed
  • mousemove — mouse moves (desktop only)

Critical CSS

Critical CSS contains only the styles needed to render above-the-fold content. It is inlined in the <head> so the browser can paint the visible page immediately, without waiting for full stylesheets to download.

SettingDefaultDescription
Critical CSS EnabledDisabledEnable Critical CSS feature
Auto-GenerateDisabledAutomatically extract critical CSS from page output
Manual Critical CSSEmptyPaste manually written critical CSS here (overrides auto-generated if filled)
Per-Template Critical CSSDisabledDefine different critical CSS for homepage, single posts, archives, and WooCommerce pages
Fallback BehaviorAsync CSSHow to load the full stylesheet after critical CSS: Async (media=print onload) or Preload

Auto-Generate Process:

  1. Enable Critical CSS and click Generate on the homepage (or any representative page)
  2. Prime Cache renders the page at a standard viewport size and extracts above-the-fold styles
  3. The result is stored and inlined on subsequent cached page serves
  4. Preview the page visually to verify no content is unstyled during load
  5. If any visible element appears unstyled, add its CSS selector to the Include Selectors list and regenerate
Tip: Auto-generated Critical CSS works best for sites with a consistent header/hero design. For highly custom themes, use Manual Critical CSS to ensure accuracy. Critical CSS reduces Largest Contentful Paint (LCP) times significantly and is one of the highest-value optimizations available.

Remove Unused CSS

Analyzes each page and strips CSS rules that do not apply to any element on that specific page. This can reduce stylesheet size by 60-90% on sites using large CSS frameworks like Bootstrap or Tailwind.

SettingDefaultDescription
Remove Unused CSSDisabledEnable per-page CSS stripping
Safelist SelectorsEmptyCSS selectors to always keep, even if not detected on page load (e.g., dynamically added classes, modal selectors). One per line, supports wildcards.
Excluded PagesEmptyURL patterns where unused CSS removal should not run (e.g., page builder edit URLs)
Warning: Remove Unused CSS can strip styles for elements that appear only after user interaction (dropdowns, modals, tooltips, sticky headers). Always add dynamically shown selectors to the Safelist. Test all interactive elements after enabling.
Optimize CSS Delivery: In the Optimize CSS Delivery setting you choose between two modes: Remove Unused CSS (aggressive, per-page stripping) and Async CSS (load the full stylesheet asynchronously). Async CSS is safer; Remove Unused CSS is more effective but requires careful safelist configuration.

Local Google Analytics Hosting

Downloads and self-hosts gtag.js (Google Analytics 4) or analytics.js (Universal Analytics) on your own server. This eliminates the Google DNS lookup and allows the script to be served from your CDN, improving PageSpeed scores and reducing third-party render-blocking time.

SettingDefaultDescription
Local Analytics EnabledDisabledSelf-host the Google Analytics script
Measurement IDEmptyYour GA4 Measurement ID (e.g., G-XXXXXXXXXX) or UA-XXXXXX-X
Update FrequencyWeeklyHow often to refresh the locally cached script (Daily / Weekly / Monthly)
Script PositionHeaderEnqueue in <head> (recommended) or footer

How to Configure:

  1. Go to Prime Cache → File Optimization → Local Analytics
  2. Enable Local Analytics
  3. Enter your GA4 Measurement ID (found in Google Analytics → Admin → Data Streams)
  4. Save settings. Prime Cache will download the script immediately.
  5. Verify in PageSpeed Insights that the Google Analytics script is no longer flagged as third-party
Tip: Google updates gtag.js regularly. Set the update frequency to Weekly to stay current without sacrificing the caching benefits of local hosting.

Google Fonts Optimization

Control how Google Fonts are loaded. These settings apply to fonts loaded via the Google Fonts API (fonts.googleapis.com). Configured under Prime Cache → File Optimization → Google Fonts.

OptionDescription
CombineMerge multiple fonts.googleapis.com API requests into a single request. Reduces DNS lookups when a theme loads many font families separately.
Self-hostDownload all requested Google Fonts (all weights and subsets) to your server and serve them locally. Eliminates the Google Fonts CDN DNS lookup entirely and ensures GDPR-friendlier font loading.
Display SwapAppend display=swap to all Google Fonts requests so text remains visible using a fallback font while the custom font loads. Prevents invisible text flash (FOIT).
DisableCompletely dequeue all Google Fonts requests. Use this if you have already replaced all Google Fonts with locally hosted equivalents in your theme.
Self-host + Preconnect: When self-hosting is enabled, Prime Cache automatically adds a <preconnect> hint for fonts.gstatic.com during the download phase and removes it afterward. After fonts are self-hosted, the preconnect is no longer needed and is omitted from page output.
GDPR note: Self-hosting Google Fonts prevents the browser from connecting to Google’s servers on page load, which avoids transmitting your visitor’s IP address to Google. This is increasingly required by European data protection regulations.

Media Optimization (Pro)

WebP conversion itself, bulk Media Library optimization, and the three delivery methods (.htaccess rewrite, <picture> tag, URL rewrite) are part of the Free edition (since 1.10.0). The Pro add-on layers AVIF conversion, AVIF-specific quality control, EXIF stripping, on-upload resize, and YouTube thumbnail replacement on top. Settings are under Prime Cache → Media.

WebP & AVIF Conversion

WebP conversion is configured in the Free plugin (see the Free Manual). When the Pro add-on is active, the same Media tab gains an AVIF toggle and AVIF-specific quality controls. At delivery time the browser receives AVIF, WebP, or the original file automatically based on its Accept header — Safari and other AVIF-less browsers cleanly fall back to the Free WebP variant.

SettingProvided byDefaultDescription
WebP ConversionFree (since 1.10.0)DisabledConvert uploads to WebP format automatically on upload
AVIF ConversionPro add-onDisabledConvert uploads to AVIF format automatically on upload. Requires Imagick with libavif or GD with AVIF (PHP 8.1+).
Conversion LibraryFree / ProAuto-detectGD or Imagick. Auto-detect selects the best available library.
Format support: WebP is supported by all modern browsers (Chrome 32+, Firefox 96+, Safari 14+, Edge 18+). AVIF is supported by Chrome 85+, Firefox 93+, Safari 16+. For older browsers, Prime Cache falls back to the original JPG/PNG via the selected delivery method.

Quality Control & EXIF Removal

Fine-tune output quality and strip unnecessary metadata from converted images.

SettingDefaultDescription
Lossy CompressionDisabledApply lossy compression for smaller file sizes (recommended for photographs)
Lossless CompressionDisabledApply lossless compression. Larger files than lossy but no quality reduction (recommended for graphics and logos)
Custom Quality82WebP/AVIF quality level (1-100). 80-85 is visually lossless for most photographs.
WebP Quality82Quality level specifically for WebP output
AVIF Quality60Quality level for AVIF output. AVIF achieves good quality at lower values than WebP.
Remove EXIF DataDisabledStrip EXIF metadata (camera model, GPS location, timestamps) from converted images. Recommended for privacy and smaller file sizes.
Recommended settings: For photographs, use Lossy with WebP Quality 82 and AVIF Quality 60. For logos and UI graphics, use Lossless. Enable EXIF removal on any site where images may be uploaded by users, as EXIF can contain GPS coordinates and device information.

Image Resize on Upload

Automatically downscale oversized images when they are uploaded to the Media Library. This prevents unnecessarily large originals from consuming disk space and being served to visitors.

SettingDefaultDescription
Resize on UploadDisabledResize images exceeding the configured maximum dimensions on upload
Max Width2560 pxMaximum image width after resize. Images narrower than this are not resized.
Max Height2560 pxMaximum image height after resize
Tip: A maximum width of 1920px covers full-width images on the largest common monitors. If your theme never displays images wider than 1200px, set that as the maximum to save additional disk space.

Bulk Optimization

Convert and compress all existing images in your Media Library without re-uploading them. A real-time AJAX progress bar shows conversion status per image.

FeatureDescription
Start Bulk OptimizationBegin converting all unoptimized images. Processes in batches to avoid server timeouts.
Progress BarShows current image number, total count, and percentage complete in real time
Pause / ResumePause optimization at any time and resume later without losing progress
Per-image StatusEach image shows its status: Optimized, Skipped (already done), or Failed (with reason)
Restore OriginalsRoll back a selected image to its pre-optimization state if backups are enabled
StatisticsTotal bytes saved, average compression ratio, number of images optimized
Media Library Column: After optimization, a Compression column appears in the Media Library list view showing the file size reduction percentage for each image (e.g., “42% smaller”). This column is sortable.

How to Run Bulk Optimization:

  1. Configure WebP and/or AVIF conversion settings first
  2. Go to Prime Cache → Media → Bulk Optimization
  3. Review the summary (total images, estimated time)
  4. Click Start Bulk Optimization
  5. Monitor progress. You can navigate away and return; the process continues in the background.
  6. Review the completion report for any failed images and address them individually if needed

Image Delivery Methods

Choose how converted WebP/AVIF images are served to browsers that support them. Prime Cache supports three delivery methods to accommodate different server configurations.

MethodHow It WorksBest For
.htaccess RewriteApache rewrite rules serve the WebP/AVIF version when the browser sends a matching Accept header and the converted file exists. Zero JavaScript, no extra HTML markup.Apache hosting; maximum performance
<picture> TagReplaces <img> tags with <picture> elements containing multiple <source> elements. Browser selects the best supported format automatically.Nginx / LiteSpeed; shared hosting without .htaccess access
URL RewriteRewrites image URLs directly to the WebP/AVIF file path. Simpler than picture tags but relies on all browsers accepting the URL-referenced format.Edge cases where picture tags cause layout issues
Recommended: Use .htaccess Rewrite on Apache servers for the cleanest implementation. Use <picture> Tag on Nginx servers or any host where you cannot modify .htaccess.

Per-folder Include/Exclude: By default, all image uploads are converted. You can restrict conversion to specific folders or exclude certain directories:

  • Include folders: Only convert images in these paths (e.g., wp-content/uploads/, wp-content/themes/)
  • Exclude folders: Skip these paths during conversion (e.g., wp-content/uploads/2020/ for archive images you do not want to re-convert)

YouTube Thumbnail Replacement

Replaces YouTube iframe embeds with a lightweight thumbnail image and a play button overlay. The actual YouTube player iframe loads only when the visitor clicks the thumbnail, dramatically reducing page weight for pages with multiple embedded videos.

SettingDefaultDescription
YouTube Thumbnail ReplacementDisabledReplace YouTube iframes with clickable thumbnails
Thumbnail QualityHigh (hqdefault)YouTube thumbnail resolution: maxresdefault (1280px) / hqdefault (480px) / mqdefault (320px)
Play Button StyleDefaultBuilt-in play button overlay style: Default, Large, Custom
Performance impact: Each embedded YouTube iframe loads approximately 500 KB of scripts and makes 20+ DNS requests on its own. Replacing three iframes with thumbnails can save over 1.5 MB of initial page load weight.

CDN Integration

Connect Prime Cache to your Content Delivery Network for global asset distribution. Settings are under Prime Cache → CDN.

CDN URL Rewriting & Domain Sharding

Rewrites static asset URLs to point to your CDN pull-zone, offloading bandwidth and serving assets from the closest CDN edge node to your visitors.

SettingDefaultDescription
CDN URL RewritingDisabledEnable CDN URL rewriting for static assets
CDN URLEmptyYour CDN pull-zone URL (e.g., https://cdn.example.com)
Include File Typesjs, css, png, jpg, gif, webp, avif, woff2, svgFile extensions to rewrite to CDN URLs
Exclude PathsEmptyURL path patterns to exclude from CDN rewriting (one per line)
Domain ShardingDisabledEnable multiple CDN hostnames for parallel asset downloads
Shard HostnamesEmptyUp to 4 CDN hostnames (e.g., cdn1.example.com, cdn2.example.com). Assets are distributed round-robin.
CDN Setup: Most CDN providers (BunnyCDN, KeyCDN, Cloudflare, etc.) work in pull-zone mode: you provide your origin URL and the CDN fetches and caches assets on first request. Set your CDN pull-zone URL as the CDN URL in Prime Cache settings.

How to Configure:

  1. Create a pull-zone in your CDN provider’s dashboard pointing to your WordPress site origin URL
  2. Copy the CDN pull-zone URL (e.g., https://yoursite.b-cdn.net)
  3. Go to Prime Cache → CDN
  4. Enable CDN URL Rewriting
  5. Paste your CDN URL
  6. Save settings and purge all cache
  7. Open browser DevTools (Network tab) and confirm static assets are loading from the CDN hostname

Cloudflare Integration

When your site is proxied through Cloudflare, Prime Cache can automatically purge the Cloudflare edge cache whenever WordPress content is updated. This ensures visitors always see fresh content without waiting for the default Cloudflare cache TTL to expire.

SettingDefaultDescription
Cloudflare IntegrationDisabledEnable Cloudflare API integration
API TokenEmptyCloudflare API Token with Zone.Cache Purge permission
Zone IDEmptyYour Cloudflare Zone ID (found in the Zone Overview page)
Zone Purge on FlushEnabledPurge the entire Cloudflare zone cache when Prime Cache’s “Purge All” is triggered
Per-URL PurgeEnabledPurge only the specific URL(s) affected when a post is updated, rather than the entire zone

Creating a Cloudflare API Token:

  1. Log in to your Cloudflare dashboard
  2. Go to My Profile → API Tokens
  3. Click Create Token
  4. Use the Edit Cloudflare Workers template, or create a custom token
  5. Set permissions: Zone → Cache Purge → Purge
  6. Limit the token to your specific zone (domain)
  7. Create the token and copy it immediately (it is only shown once)
  8. Paste the token and your Zone ID into Prime Cache CDN settings
  9. Click Test Connection to verify
Tip: Use per-URL purge whenever possible to minimize disruption. Zone-wide purge is appropriate only after major site-wide changes (theme switch, mass content update). Per-URL purge is called automatically via Prime Cache’s auto-purge triggers.

Sucuri Firewall Integration

If your site uses the Sucuri Website Application Firewall (WAF), Prime Cache can clear Sucuri’s cache automatically when content changes.

SettingDefaultDescription
Sucuri IntegrationDisabledEnable Sucuri cache sync
API KeyEmptySucuri API key (found in Sucuri Dashboard → API)
API SecretEmptySucuri API secret
Note: Sucuri API credentials are found in your Sucuri Dashboard under Settings → API. After enabling, Prime Cache sends a cache clear request to Sucuri on every Prime Cache purge event.

Varnish HTTP PURGE

For hosting environments with a Varnish cache in front of the web server, Prime Cache can send HTTP PURGE requests to invalidate specific cached objects.

SettingDefaultDescription
Varnish IntegrationDisabledEnable Varnish PURGE requests
Varnish IP127.0.0.1IP address of the Varnish server (usually localhost for co-located setups)
Varnish Port6081Varnish listening port
Use Regex PurgeDisabledUse BAN with regex instead of exact URL purge (requires Varnish VCL support)

Preloading (Pro)

Preloading warms the cache before visitors arrive and signals the browser to fetch resources it will need soon. Pro provides a full suite of preloading tools. Settings are under Prime Cache → Preload.

Cache Preloading

Crawls your site in the background and populates the page cache without waiting for real visitors. Ensures every page is served from cache even on the first visit after a cache purge.

SettingDefaultDescription
Cache PreloadingDisabledEnable background cache warming
Preload DesktopEnabledPreload desktop cache variants
Preload MobileDisabledPreload separate mobile cache variants (requires Separate Mobile Cache to be enabled in Page Cache settings)
Preload Interval900 secondsTime between preload passes. Lower values keep cache warmer; higher values reduce server load.
Concurrent Requests3Number of parallel preload requests. Increase for faster preloading; decrease on low-resource servers.
Preload on Settings SaveEnabledAutomatically start a preload pass when settings are saved
Preload on Plugin ActivationEnabledStart preloading immediately after Prime Cache is activated
Vary Cookies note: When Vary Cookies are configured (for cookie-keyed cache variants), only the default (unauthenticated) cache variant is preloaded. Cookie-specific variants (e.g., for logged-in users with personalized content) are generated on first visitor request since the preloader does not have access to visitor-specific cookies.

Sitemap Preloading

Reads your XML sitemap to discover URLs and preload them. This is particularly useful for large sites where database-based URL discovery may miss some pages.

SettingDefaultDescription
Sitemap PreloadingDisabledDiscover URLs from sitemap and include them in preloading
Sitemap URLAuto-detectYour sitemap URL. Auto-detect finds /sitemap.xml, /sitemap_index.xml, and sitemaps declared in robots.txt automatically.
Sitemap Index SupportEnabledFollow sitemap index files to discover child sitemaps
Tip: If you use an SEO plugin (Yoast SEO, Rank Math, All in One SEO), its sitemap is automatically detected. Sitemap preloading combined with database preloading provides the most comprehensive cache coverage.

Instructs the browser to fetch pages the visitor is likely to navigate to next, before they click. When the visitor does click, the page loads from the browser’s cache — appearing nearly instant.

SettingDefaultDescription
Link PrefetchingDisabledEnable JavaScript-based link prefetching
Hover PrefetchEnabledBegin fetching a page when the cursor hovers over its link (typically 200-300ms before a click)
Hover Delay65 msMilliseconds to wait after hover before prefetching, to avoid prefetching on brief accidental hovers
Viewport PrefetchDisabledPrefetch links as soon as they scroll into the visible viewport using IntersectionObserver
Prefetch Limit10Maximum number of pages to prefetch per session, to avoid excessive bandwidth consumption
Exclude Patternswp-admin, /cart/, /checkout/URL patterns to skip (admin pages, WooCommerce transactional pages, logout links)
Tip: Hover prefetch has an excellent signal-to-noise ratio — most hover events over links do result in a click within a few hundred milliseconds. Enable hover prefetch before viewport prefetch; the latter uses more bandwidth by prefetching everything in view.

Speculation Rules API

The Speculation Rules API is a modern browser feature (Chrome 109+) that enables prerendering — the browser fetches and renders the full page in a hidden tab before the user navigates to it. When the user clicks a link, the prerendered page is displayed instantly with zero perceptible load time.

SettingDefaultDescription
Speculation RulesDisabledInject Speculation Rules JSON into page output
Speculation Modeprefetchprefetch: fetch only (safe, low overhead). prerender: full render (maximum speed, higher resource use).
Eagernessmoderateconservative (on pointer down), moderate (on hover), eager (immediately). Higher eagerness = more pages prerendered but higher bandwidth use.
Exclude Patternswp-admin, /cart/, /checkout/, /logout/URL patterns excluded from prerendering rules
Browser support: Chrome 109+, Edge 109+ support prerender via Speculation Rules. Firefox and Safari do not support this API yet but silently ignore the injected JSON. For non-supporting browsers, link prefetching provides a graceful fallback.

Example Speculation Rules JSON (generated by Prime Cache):

{
  "prefetch": [{
    "source": "document",
    "where": {
      "and": [
        {"href_matches": "/*"},
        {"not": {"href_matches": ["/wp-admin/*", "/cart/", "/checkout/*", "/logout/"]}},
        {"not": {"selector_matches": "a[rel~='nofollow']"}}
      ]
    },
    "eagerness": "moderate"
  }]
}

LCP Optimization

Largest Contentful Paint (LCP) measures how quickly the largest visible element (typically a hero image) loads. Prime Cache can automatically identify and prioritize LCP elements using fetchpriority="high" and resource preloading.

SettingDefaultDescription
LCP OptimizationDisabledEnable automatic LCP element detection and prioritization
Add fetchpriorityEnabledAdd fetchpriority="high" to the detected LCP image element
Add PreloadEnabledAdd a <link rel="preload"> hint for the LCP image in <head>
Skip First N Images1Apply fetchpriority=”high” to the first N images and skip lazy-loading them. The first image in the viewport is almost always the LCP element.
Manual LCP URLEmptyOverride auto-detection by specifying the LCP image URL explicitly
How it works: Prime Cache scans the page HTML for the first image tag in the main content area. It adds fetchpriority="high" and removes the loading="lazy" attribute (since the LCP element must not be lazy-loaded). A corresponding preload link is injected in the document head. This signals to the browser to download this image with top priority.

DNS Prefetch & Preconnect

Early connection hints that reduce the overhead of connecting to external domains. These hints are injected into <head> so the browser can resolve DNS, complete the TCP handshake, and negotiate TLS before any resource from those domains is actually requested.

SettingDefaultDescription
DNS PrefetchDisabledInject <link rel="dns-prefetch"> hints for external domains detected on the page
DNS Prefetch URLsEmptyManual list of external domains to prefetch (one per line, e.g., //fonts.googleapis.com)
PreconnectDisabledInject <link rel="preconnect"> hints (includes DNS + TCP + TLS, stronger than dns-prefetch)
Preconnect URLsEmptyExternal origins to preconnect to (e.g., https://fonts.gstatic.com)
Limit Hints4Maximum number of preconnect/dns-prefetch hints. Cap at 4 to avoid consuming browser connection capacity.
Remove Self-OriginEnabledDo not emit hints for your own domain (wasted hint)
Tip: Preconnect is stronger than DNS prefetch but uses more resources. Use preconnect for domains from which you load render-blocking resources (Google Fonts, CDN) and dns-prefetch for others (analytics, social pixels).

Font Preloading

Automatically detects fonts declared in your CSS @font-face rules and injects <link rel="preload"> hints for them in the document head. This eliminates font-induced layout shift and invisible text flash.

SettingDefaultDescription
Font PreloadingDisabledAuto-detect and preload @font-face fonts
Manual Font URLsEmptyAdditional font file URLs to preload (one per line). Use for fonts not discoverable from CSS.
Preload Limit3Maximum fonts to preload. More than 3-4 preloads compete for bandwidth and may slow the LCP image.

Manual Resource Preloading

Specify individual resources to preload. Prime Cache auto-detects the resource type and generates the appropriate <link rel="preload"> tag with the correct as= attribute.

SettingDefaultDescription
Manual Preload URLsEmptyOne resource URL per line. Type is auto-detected from file extension (script, style, font, image, fetch).

Example:

/wp-content/themes/my-theme/fonts/hero-font.woff2
/wp-content/themes/my-theme/css/critical-above-fold.css
/wp-content/uploads/hero-image.webp

Object Cache

Persistent object caching stores the results of expensive WordPress database queries and function calls in a fast in-memory store. Repeated queries are served from memory rather than hitting the database, dramatically reducing TTFB (Time to First Byte) for dynamic pages. Settings are under Prime Cache → Object Cache.

How WordPress Object Cache Works: WordPress has a built-in object cache that is discarded at the end of every page request. A persistent object cache backend (APCu, Redis, or Memcached) makes the cache survive between requests, so frequently accessed data is retrieved from memory rather than re-queried from the database on every page load.

APCu Backend

APCu (Alternative PHP Cache user store) stores cache data in PHP’s shared memory segment on the same server. It is the simplest backend to configure — no additional daemon required.

SettingDefaultDescription
BackendNoneSelect APCu to use the APCu backend
APCu StatusSystem Information shows whether APCu is enabled and its memory allocation
Cache Prefixpc_Key prefix to namespace Prime Cache entries within the APCu store
Requirement: APCu must be enabled in your PHP configuration (apc.enabled=1). On shared hosting, it may be enabled by default. On VPS/dedicated servers, install via pecl install apcu and add extension=apcu.so to your php.ini.
APCu Limitation: APCu cache is local to a single server and is lost on server restart or PHP process restart. It is not suitable for multi-server environments. Use Redis or Memcached for load-balanced or cloud hosting setups.

Redis Backend

Redis is a high-performance in-memory data store with persistence options and support for multi-server deployments. It is the recommended object cache backend for production sites.

SettingDefaultDescription
BackendNoneSelect Redis to use the Redis backend
Host127.0.0.1Redis server hostname or IP address
Port6379Redis server port
PasswordEmptyRedis AUTH password (leave empty if no password is set)
Database0Redis database index (0-15)
Timeout1 secondConnection timeout. Increase if Redis is on a remote server.
Cache Prefixpc_Key prefix to namespace entries within the Redis store

How to Configure Redis:

  1. Ensure Redis is running on your server (redis-cli ping should return PONG)
  2. Ensure the PHP phpredis extension is installed and enabled
  3. Go to Prime Cache → Object Cache
  4. Select Redis as the backend
  5. Enter the host, port, and password (if any)
  6. Click Test Connection to verify connectivity
  7. Save settings. Prime Cache installs the object-cache drop-in (wp-content/object-cache.php) automatically.

Memcached Backend

Memcached is a distributed memory caching system. It is well-suited for load-balanced environments where multiple web servers share a single cache pool.

SettingDefaultDescription
BackendNoneSelect Memcached to use the Memcached backend
Servers127.0.0.1:11211Memcached server list. One host:port per line for multi-server pools.
Cache Prefixpc_Key prefix for Memcached entries
Requirement: The PHP Memcached extension (libmemcached-based) is required. Note this is different from the older Memcache extension. Verify with php -m | grep memcached.

Database Optimization

WordPress accumulates database bloat over time: post revisions, auto-drafts, orphaned metadata, spam comments, and expired transients. Prime Cache Pro provides a one-click cleanup interface and automatic scheduled maintenance. Settings are under Prime Cache → Database.

Cleanup Items

Each cleanup item shows the current count of affected rows so you can make an informed decision before deleting. Review the counts before running cleanup.

Cleanup ItemDescription
Post RevisionsDelete all saved revision history for posts and pages. WordPress stores a new revision on every save; these accumulate rapidly on active sites.
Auto DraftsRemove auto-save drafts that WordPress creates in the background while you edit. They are unnecessary once a post is published.
Trashed PostsPermanently delete posts and pages that have been moved to the WordPress Trash. Equivalent to “Empty Trash.”
Spam CommentsPermanently remove all comments marked as spam. Spam accumulates quickly on unprotected sites.
Trashed CommentsPermanently remove comments in the Trash.
Expired TransientsDelete transient records whose expiry date has passed. These are temporary option values set by plugins and WordPress core; expired ones are never read but remain in the database.
All TransientsDelete all transients, including unexpired ones. Use with caution — some plugins rely on transients for caches and will regenerate them on next request. Site performance may temporarily dip after clearing all transients.
Table OptimizationRun MySQL OPTIMIZE TABLE on all WordPress tables. Reclaims disk space fragmented by deletions and re-indexes tables for faster queries.
Warning: Database cleanup is irreversible. Post revisions, trashed content, and spam comments cannot be recovered after deletion. Take a full database backup before running cleanup for the first time.

How to Run Cleanup:

  1. Go to Prime Cache → Database
  2. Review the row counts for each cleanup item
  3. Check the boxes for items you want to clean
  4. Click Run Cleanup Now
  5. Wait for the completion notice showing how many rows were deleted
  6. Click Optimize Tables after deletion to reclaim fragmented space

Automatic Cleanup Schedule

Configure automatic database maintenance on a recurring schedule via WordPress WP-Cron. Set it and forget it.

SettingDefaultDescription
Automatic CleanupDisabledEnable scheduled automatic cleanup
ScheduleWeeklyCleanup frequency: Daily / Weekly / Monthly
Cleanup ItemsRevisions, Expired TransientsWhich items to clean on each scheduled run. Check only items safe to remove automatically.
Next RunDisplays the timestamp of the next scheduled cleanup
Recommended schedule: Weekly cleanup of post revisions, auto drafts, spam/trashed comments, and expired transients. Run table optimization monthly (it is more resource-intensive). Avoid scheduling “All Transients” for automated cleanup unless you have verified no critical plugins depend on long-lived transients.
WP-Cron dependency: Scheduled cleanup relies on WordPress WP-Cron. On low-traffic sites, WP-Cron may not run on time if no visitors trigger it. For reliable scheduling on low-traffic sites, set up a real system cron that calls wp-cron.php at the desired interval.

Heartbeat API Control

The WordPress Heartbeat API sends AJAX requests to the server at regular intervals to maintain session state, notify about autosaves, and provide live updates. On high-traffic sites, these requests add measurable server load. Prime Cache lets you control Heartbeat behavior per location. Settings are under Prime Cache → Performance Tweaks → Heartbeat.

Heartbeat Settings

Configure the Heartbeat API independently for three locations:

LocationDefault BehaviorImpact of Disabling
FrontendDisabled by default in WordPress coreNegligible (not normally active)
Admin DashboardActive every 60 secondsLoss of real-time dashboard notifications (plugin updates, comment counts)
Post EditorActive every 15 secondsAutosave still works; only real-time “post lock” and simultaneous edit warnings are lost

For each location, three modes are available:

ModeDescription
AllowHeartbeat operates normally at its default interval. No change from standard WordPress behavior.
Reduce FrequencyHeartbeat runs at a longer interval (configurable, 15-300 seconds). Reduces AJAX request frequency while preserving functionality.
DisableHeartbeat is completely disabled for this location. No AJAX polling occurs.
SettingDefaultDescription
Frontend ModeAllowHeartbeat behavior on the public-facing frontend
Admin Dashboard ModeAllowHeartbeat behavior in the WordPress admin dashboard
Post Editor ModeAllowHeartbeat behavior in the block editor and classic editor
Custom Interval60 secondsInterval in seconds when Reduce Frequency mode is active (range: 15-300)
Recommended configuration: Set Admin Dashboard to Reduce Frequency at 120 seconds (reduces load without losing notifications), and set Post Editor to Reduce Frequency at 60 seconds (still autosaves frequently). Disable Heartbeat on the Frontend entirely if it is active.

Security & Advanced Caching

Security Headers

Prime Cache can inject HTTP security headers with every response. These headers instruct the browser to enforce security policies that protect visitors against common web attacks. Settings are under Prime Cache → Tools → Security Headers.

HeaderDefault ValueDescription
HSTS (Strict-Transport-Security)DisabledForces browsers to connect via HTTPS only. Configure max-age (recommended: 31536000 = 1 year), and optionally includeSubDomains and preload.
X-Content-Type-OptionsDisabledSet to nosniff to prevent browsers from MIME-sniffing responses away from the declared content type. Mitigates drive-by download attacks.
X-Frame-OptionsDisabledControls whether your site can be embedded in an iframe. Use SAMEORIGIN to allow same-domain framing only, or DENY to block all framing. Prevents clickjacking.
X-XSS-ProtectionDisabledEnables legacy browser XSS filter. Set to 1; mode=block. Note: modern browsers rely on CSP instead, but this header supports older browsers.
Referrer-PolicyDisabledControls how much referrer information is included with requests. Recommended: strict-origin-when-cross-origin (sends full URL within same origin, only origin for cross-origin).
Permissions-PolicyDisabledRestricts which browser features (camera, microphone, geolocation, etc.) pages and embedded content can use. Customize based on your site’s requirements.
HSTS Warning: Once HSTS is deployed with a long max-age, browsers will refuse HTTP connections to your site for the entire duration. Ensure your HTTPS setup is rock-solid before enabling HSTS. Do not enable preload unless you intend to submit your domain to browser HSTS preload lists (this is very difficult to reverse).

Recommended Security Header Configuration:

Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()

Advanced Caching Options

Fine-tune how the page cache behaves for specific scenarios. Settings are under Prime Cache → Page Cache → Advanced.

SettingDefaultDescription
Cookie-Keyed Cache (Vary Cookies)EmptyList of cookie names. When any listed cookie is present with a specific value, a separate cache variant is stored for that cookie value. Useful for sites with user-specific content variations beyond login state (e.g., currency preference, A/B test assignment).
Query-String-Keyed CacheDisabledCache pages separately per query string combination. Required if your site serves different content based on URL parameters. Disabled by default to prevent cache bloat from crawler bots with arbitrary query strings.
Cache Query StringsEmptySpecific query string parameter names to include in cache key (whitelist approach). Parameters not listed are stripped from the cache key.
404 Page CachingDisabledCache 404 Not Found pages. Reduces server load from bots repeatedly requesting non-existent URLs. Cached 404s are served with the correct HTTP status code.
Always Purge URLsEmptyAdditional URLs to purge on every cache clear event. Useful for pages that aggregate content (homepage, news index) that should be invalidated whenever any post changes.
Vary Cookies and Preloading: When Vary Cookies are configured, the cache preloader generates only the default (cookie-free) variant. Visitor-specific variants are created on first request. Plan accordingly for sites where most traffic is cookie-keyed — your TTFB on first visit to a variant will be uncached.

Cache Exclusions

Define rules to prevent specific pages, URL patterns, cookies, user agents, or referrers from being served or stored in the cache. Settings are under Prime Cache → Page Cache → Exclusions.

Exclusion TypeDescription
Exclude URLsURL patterns (one per line, supports wildcards with *) that should never be cached. For example: /account/*, /checkout/*, /api/*
Exclude CookiesIf any listed cookie is present in the request, the page is not cached. Default exclusions include WooCommerce cart cookies and login cookies.
Exclude User AgentsRequests from matching user agent strings bypass caching. Useful for excluding specific bots or monitoring services that should see live content.
Exclude ReferrersRequests arriving from specific referrer domains bypass caching. Rarely needed; use with care.
Default exclusions: Prime Cache automatically excludes the WordPress admin area, login pages, WooCommerce cart/checkout/account pages, and requests with active WordPress login cookies. You do not need to add these manually.

Per-Post Cache Control

Disable caching for individual posts or pages directly from the post editor, without creating a URL exclusion rule.

Edit any post or page. In the sidebar, locate the Prime Cache metabox. Check Disable cache for this page. Save the post. That specific URL will now always bypass the cache and serve a live PHP response.

Use case: Useful for membership pages that conditionally show different content based on user role, landing pages that use server-side A/B testing, and pages that embed real-time data widgets that must not be cached.

Frequently Asked Questions

FAQ

Q: Does Prime Cache Pro require the free version?

Yes. Prime Cache Pro is an add-on plugin. The free Prime Cache plugin must be installed and activated first. The Pro add-on extends it with additional settings tabs and features.

Q: Can I use the same license key on multiple sites?

No. Each Pro license is tied to one production domain. Purchase additional licenses for additional sites. Development and staging environments may be activated temporarily (deactivate before reactivating on a different domain).

Q: Why does my page look broken after enabling Combine CSS or Combine JS?

CSS/JS combining occasionally breaks sites when stylesheets depend on a specific load order or when scripts use document.write(). To resolve: add the problem script or stylesheet’s filename to the corresponding Exclude list in File Optimization settings. Purge all cache and reload.

Q: WebP images are not being served despite conversion being enabled. What should I check?

  1. Confirm the converted .webp files exist alongside the originals in wp-content/uploads/
  2. If using .htaccess Rewrite delivery: verify mod_rewrite is enabled and the Prime Cache .htaccess rules are present
  3. Check your browser’s request headers — it must send Accept: image/webp (all modern browsers do)
  4. If using a CDN or reverse proxy, ensure it passes the Accept header to the origin and does not serve a cached JPG to WebP-supporting browsers
  5. Verify the GD or Imagick library is available via System Information

Q: Does Delay JavaScript break the contact form, sliders, or other interactive elements?

It can. Enable Delay JS Safe Mode first (delays only external scripts) to identify if the issue is from first- or third-party scripts. For first-party scripts that break with Safe Mode off, add their URL fragment or script handle to the Delay Exclusion list.

Q: What is the difference between Remove Unused CSS and Critical CSS?

These solve different problems and can be used together:

  • Critical CSS: Extracts the styles needed for above-the-fold content and inlines them in <head> so the first paint happens immediately. The full stylesheet is loaded asynchronously.
  • Remove Unused CSS: Strips CSS rules that match no elements on a given page. Reduces the full stylesheet size but does not change when it loads.

Critical CSS improves LCP and perceived load speed. Remove Unused CSS reduces total CSS payload. Together, they maximize CSS delivery performance.

Q: The Speculation Rules API is enabled but I do not see faster navigation.

Check that you are testing in Chrome 109+ (or Edge 109+). Open Chrome DevTools → Application → Background Services → Speculation Rules to confirm rules are being parsed and which URLs are being prerendered. If no URLs are listed, check that the page contains internal links and that they are not matching the exclude patterns.

Q: Can I use Prime Cache Pro with a Nginx server?

Yes. All PHP-based features work on Nginx. The .htaccess optimization feature is Apache-specific and should be disabled on Nginx. For WebP/AVIF delivery on Nginx, use the <picture> Tag delivery method instead of .htaccess Rewrite. CDN, preloading, file optimization, and all other features function normally on Nginx.

Q: Does Prime Cache Pro support WordPress Multisite?

Page caching is not supported on multisite installations. All other Pro features (file optimization, image optimization, CDN, preloading, database cleanup, heartbeat control, security headers) work normally on multisite individual sites.

Q: My Cloudflare zone purge is not working. What should I check?

  1. Verify the API Token has Zone.Cache Purge permission for the correct zone
  2. Confirm the Zone ID matches the zone your domain is in (visible in the Cloudflare zone Overview page sidebar)
  3. Ensure your server can make outbound HTTPS requests to api.cloudflare.com
  4. Click Test Connection in the CDN settings and check the response message for error details

Q: How do I restore an image to its original quality after bulk optimization?

Prime Cache stores the original image alongside the converted versions (it does not overwrite the original). In the Media Library, select the image, click Edit, and use the Restore Original button in the Prime Cache section. Note: if you deactivated Prime Cache and the original was cleaned up by another process, restoration may not be possible — always keep WordPress Media Library backups.

Q: The database cleanup removed my revisions. Can they be recovered?

No. Database cleanup is permanent and irreversible. Always take a full database backup before running cleanup. Many hosting providers offer one-click database backup via phpMyAdmin or cPanel.

タイトルとURLをコピーしました