跳到内容

Koci Cache

v1.1.0

kocimedia · 2026年11月16日 上架

Lightweight page cache with CSS/JS and media optimization: static HTML served before WordPress loads, safe defaults, no bloat.

正在使用
10 以下
评分
暂无
累计下载
111
最近更新
2026年11月17日
需要 WordPress 6.5+已测试到 7.1.5PHP 7.4+

贡献者

截图

The Overview tab with the installation status and the cache statistics.
The Overview tab with the installation status and the cache statistics.
The cache settings.
The cache settings.
The CSS and JavaScript optimization settings.
The CSS and JavaScript optimization settings.
The media settings (lazyload, image dimensions, fonts).
The media settings (lazyload, image dimensions, fonts).

Koci Cache saves every page as a static HTML file and serves it before WordPress loads (through the standard 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?

  • Small and readable – one settings page, no upsells, no accounts, no external service. The whole plugin is a few hundred kilobytes.
  • Safe by default – logged-in users, carts, checkouts, password-protected pages, POST requests and pages with a query string (unless you allow its keys) are never cached; a page is only stored when it is complete (with a closing </html>) and was generated for your own domain.
  • Multilingual-friendly – the cache key is the URL exactly as the browser requested it, so sites whose language plugin uses a URL prefix (/en/, /de/ …) never mix languages.
  • Shared hosting friendly – the cache warmer works in small, slow batches in the background and never blocks a visitor or an admin request.

Features

  • Page cache – static HTML files, 304 Not Modified support, optional separate mobile cache, lifespan and scheduled cleanup.
  • Automatic clearing – when a post, page, product or comment changes, only the affected page, the home page and the related archives are cleared (no full flush during a product import). Menus, widgets and the Customizer clear everything. An admin bar button clears everything by hand.
  • Advanced rules – never-cache URLs, cookies and user agents, and query string keys that may be cached (e.g. utm_source).
  • CSS – minify (files and inline styles) and an optional, cascade-safe combine.
  • JavaScript – minify, defer, and delay until the first interaction, with exclusions.
  • Media – lazyload of images (with <picture> and srcset) and iframes, skipping the first images (LCP), missing width/height, font preload and local hosting of Google Fonts.
  • Preload – after a full clear the URLs of your sitemap (WordPress, Yoast or a generic sitemap) are visited in the background; optional link prefetch on hover.
  • Repair and diagnostics – the Overview tab shows whether the drop-in and WP_CACHE are active and repairs the installation. Another cache plugin’s drop-in is never overwritten without your confirmation.

Every optimization keeps the original markup when anything goes wrong: a failed step can never break or empty a page. ?nokoci=1 shows a page without optimization for testing.

How it works, what it changes

  • On activation the plugin copies 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.
  • Everything the plugin writes is in the uploads folder, in 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.
  • Do not use it together with another page cache plugin (e.g. WP Rocket, W3 Total Cache, LiteSpeed Cache). Server-level caches (Varnish, LiteSpeed) can stay, but then let only one of them cache the HTML.

Privacy

The plugin does not track visitors, does not set cookies and does not send any data anywhere. Pages are only cached for visitors who are not logged in and have no cart, so cached files contain public pages only.

External services

Only when you switch on Google Fonts self-host (Media tab, off by default): when a page uses Google Fonts, your server downloads the Google Fonts stylesheet from 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.
  • The DONOTCACHEPAGE constant is respected.
  • Actions: koci_cache_purged_all, koci_cache_purged_post (post ID), koci_cache_cron_ran, koci_cache_preload_done.
  • Script attributes: data-koci-no (never touched), data-koci-no-delay (not delayed). Image attribute data-no-lazy or class no-lazy / skip-lazy (no lazyload).

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums