| 开发者 |
easycommerce
nirosuite |
|---|---|
| 更新时间 | 2026年9月26日 20:56 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
advanced-cache.php), before themes, plugins and database queries load..htaccess block, and a ready-to-copy configuration snippet for Nginx.utm_source, utm_campaign, gclid and fbclid share the cached page, approved parameters such as a language or currency get their own copies, and unknown parameters bypass the cache so variants never multiply.DONOTCACHEPAGE or send Cache-Control: no-cache, no-store or private are respected.
You can also exclude URLs (with * wildcards), cookies, user agents, post types, and single pages with Don't cache this page in the editor.
Compatibility
wp nirocache status, purge, preload, test, preset, enable, disable and settings.wp-content/advanced-cache.php: the standard WordPress early-cache file, copied from the plugin. It is only created if no other plugin owns it.define( 'WP_CACHE', true ); in wp-config.php: added only if WP_CACHE is not already defined. If wp-config.php is not writable, NiroCache shows the line to add.# BEGIN NiroCache in .htaccess, on Apache and LiteSpeed only, for browser caching, compression and optional direct delivery. Other blocks are never touched.wp-content/cache/nirocache/. NiroCache never overwrites another plugin's advanced-cache.php or object-cache.php.
Privacy
NiroCache does not collect or send any data, and has no account, API key or cloud service. The cache test, preloading and server checks only send requests from your server to your own site. Cached copies only ever contain pages as seen by visitors who are not logged in. Statistics are simple daily counts stored on your server.
For developers
Filters:
nirocache_should_cache — return false to keep a rendered page dynamic.nirocache_excluded_urls — URL path patterns that are never cached.nirocache_bypass_cookies — cookie name prefixes that make a visitor bypass the cache.nirocache_ignored_query_params — query parameters that share the cached copy.nirocache_allowed_query_params — query parameters that get their own cached copies, while Cache approved query strings is on.nirocache_max_query_copies — the most cached copies one page can have for approved query strings.nirocache_post_purge_urls — URLs cleared when a post changes.nirocache_site_wide_post_types — post types whose changes clear the whole cache.nirocache_commerce_paths — cart, checkout and account paths of other shops.nirocache_preload_urls — URLs to preload.nirocache_preload_spawn_cron — return false to stop NiroCache starting WP-Cron itself for preload batches.nirocache_optimize — return false to skip optimization for a page.nirocache_minify_html — return false to skip HTML minification.nirocache_html_keep_comments — HTML comments minification keeps.nirocache_excluded_css and nirocache_excluded_js — assets optimization leaves alone.nirocache_defer_js_exclusions and nirocache_delay_js_exclusions — scripts never deferred or delayed.nirocache_delay_js_timeout — how long delayed scripts wait before loading anyway.nirocache_preconnect_origins — origins to preconnect to.nirocache_conflicting_plugins and nirocache_conflicting_optimizers — plugins to warn about.nirocache_dropin_path, nirocache_wp_config_path and nirocache_htaccess_path — file locations NiroCache manages.nirocache_cache_created — a page was stored.nirocache_url_purged — a URL's cached copies were cleared.nirocache_cache_purged — the whole cache was cleared.nirocache_network_purged — every site's cache was cleared on multisite.nirocache_exclusions_changed — a page was ticked or unticked "Don't cache this page".nirocache_preload_started and nirocache_preload_completed — a preload run started or finished.NIROCACHE_CACHE_DIR constant in wp-config.php to store cached pages somewhere else.
The admin screen is a React app. Its source is included in the plugin (spa/, package.json, webpack.config.js); build/ is compiled from it with yarn build.
nirocache folder to /wp-content/plugins/.wp-config.php is not writable, add this line near the top of wp-config.php, above the line that says "That's all, stop editing!":
define( 'WP_CACHE', true );Keep Standard, which is already selected. It adds preloading and minification on top of safe page caching. Choose Basic for membership or highly dynamic sites, or if anything looks wrong after minification. Aggressive also defers and delays JavaScript and caches approved query strings; try it if you are happy to test your key pages afterwards, because some sites need exclusions.
Changing any setting that a preset controls switches you to Custom, and NiroCache asks before it does. Nothing changes on your site until you save. Your last Custom combination is remembered, so you can go back to a preset and return to your own setup later.
Logged-in users always get freshly generated pages, so nobody ever sees someone else's personal content. Click Run cache test on the dashboard, or open your site in a private browser window, to see what visitors get.
Click Run cache test on the dashboard. It requests your home page twice and reports whether the second request was served from the cache, or why it was not. You can also turn on debug headers under Settings, Advanced, and look for X-Niro-Cache: HIT in your browser's developer tools while logged out. The dashboard charts show how many pages are served from the cache each day.
Use the On/Off switch next to the Dashboard title. Off pauses everything NiroCache does to your site and clears cached pages; your settings are kept, and turning it back on restores everything. It is the quickest way to check whether a problem comes from NiroCache.
Minified files are copies kept in the cache folder; your theme and plugin files are never modified. Defer and delay are only on in Aggressive mode, and payment, checkout and consent scripts are never delayed. If something looks wrong, add the script to the JavaScript exclusions under Settings, Optimization, or switch back to Standard or Basic.
Yes. Cart, checkout and account pages are never cached, shoppers with items in their cart always get fresh pages, and product pages are cleared when their stock or price changes. Easy Digital Downloads, EasyCommerce and NiroCommerce checkout and account pages are excluded too.
Any server that runs WordPress: Apache, Nginx, LiteSpeed and others. The early cache works everywhere with no server configuration. On Apache and LiteSpeed, NiroCache can also add browser caching, compression and direct delivery rules to .htaccess; on Nginx, the Server screen shows a configuration snippet you can add if you want Nginx to deliver cached pages itself.
Running two page caches at once causes unexpected behavior, so NiroCache warns you when it detects another page cache or optimization plugin. It never overwrites another plugin's advanced-cache.php or object-cache.php. The Server screen also detects hosting caches such as LiteSpeed, Varnish, Cloudflare and managed hosts, and recommends what to do.
Tick Don't cache this page in the NiroCache box of the page editor, or add its path under Settings > Exclusions > Never cache these URLs. Use /members/* to exclude a section and everything below it. You can also exclude cookies, user agents and post types there.
WordPress form security tokens expire after 12 to 24 hours. Keep the cache lifespan at 10 hours (the default) or lower on sites with forms.
Preloading requests your pages one at a time in small batches, with a pause between pages. You can lower the batch size or lengthen the pause under Settings > Preload, or turn sitemap preloading and cache warming off.
Yes. Each site keeps its own cache and settings. Super admins can clear every site's cache at once from the admin toolbar.
Deactivating removes the early-cache file, the WP_CACHE line and the .htaccess block NiroCache added, and deletes cached pages; your settings are kept. Deleting the plugin also removes its settings, statistics and the whole cache directory.
wp-content/advanced-cache.php is now copied from a file that ships with the plugin instead of being generated. NiroCache no longer writes PHP anywhere.