| 开发者 | kocimedia |
|---|---|
| 更新时间 | 2026年11月17日 07:07 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
advanced-cache.php drop-in), so most visitors get the page without PHP and database work. Everything beyond the page cache is off by default and can be switched on one by one.
Why another cache plugin?
</html>) and was generated for your own domain.utm_source).<picture> and srcset) and iframes, skipping the first images (LCP), missing width/height, font preload and local hosting of Google Fonts.WP_CACHE are active and repairs the installation. Another cache plugin's drop-in is never overwritten without your confirmation.?nokoci=1 shows a page without optimization for testing.
How it works, what it changes
advanced-cache.php into wp-content and adds define( 'WP_CACHE', true ); (marked with a comment) to wp-config.php. On deactivation and uninstall both are removed again.wp-content/uploads/koci-cache/: the cached pages (pages/), the rules read by the drop-in (config/config.json, not readable from the web where .htaccess works), minified files (min/) and local Google Fonts (fonts/). Uninstalling deletes this folder and the settings.https://fonts.googleapis.com and the font files it refers to from https://fonts.gstatic.com once, and serves them from your own site afterwards, so the visitors' browsers no longer connect to Google. The request sends your server's IP address and a browser user agent (to get the WOFF2 files). Google Fonts: https://developers.google.com/fonts – Terms: https://policies.google.com/terms – Privacy: https://policies.google.com/privacy
The cache preload only requests pages and sitemaps of your own site.
Third-party libraries
CSS and JavaScript minification uses matthiasmullie/minify (MIT license, https://github.com/matthiasmullie/minify) and matthiasmullie/path-converter (MIT license, https://github.com/matthiasmullie/path-converter). Their source files are in the vendor folder (see composer.json), with their licenses.
For developers
koci_cache_is_cacheable (bool) – return false to keep the current page out of the cache.koci_cache_do_optimize (bool) – return false to skip the CSS/JS/media optimization for the current page.DONOTCACHEPAGE constant is respected.koci_cache_purged_all, koci_cache_purged_post (post ID), koci_cache_cron_ran, koci_cache_preload_done.data-koci-no (never touched), data-koci-no-delay (not delayed). Image attribute data-no-lazy or class no-lazy / skip-lazy (no lazyload)./wp-content/plugins/, then activate it.Open the page in a private window (you must be logged out) and look at the source: cached pages end with a <!-- Koci Cache: generated … --> comment, and the response has an X-Koci-Cache: HIT header.
Usually another cache plugin's advanced-cache.php is in wp-content, wp-config.php already has a WP_CACHE line from another plugin, or the files are not writable. The Overview tab tells which one; deactivate the other cache plugin and click "Repair installation".
Open the page with ?nokoci=1 to compare. Then add the affected file (a part of its URL) to the exclusions of that optimization, or switch it off. Delay and combine need the most testing.
Yes. Cart, checkout and account pages, and visitors with items in the cart, are never cached; product changes clear the product page, the shop page and the product categories.
assets/js, added with wp_enqueue_script(); font preload links use the wp_preload_resources filter.koci-cache/); the rules for the drop-in are a JSON file.