Gorilla Cache

Description

Gorilla Cache saves a ready-made copy of each public page and hands it to the next visitor before WordPress starts, so the page is not rebuilt for every visit. There is nothing to set up: activate it and your site is cached, unless your host or another plugin already caches it.

Safe for stores and member sites, with no setup

  • Cart, checkout, account, receipt and login pages are never cached. They are found from each plugin’s own settings, so a renamed checkout is still recognised. Tested with WooCommerce, Easy Digital Downloads and Tutor LMS; other shop, membership and course plugins are recognised from their own settings.
  • Visitors with something personal never share a page: logged-in visitors, carts, sessions and commenters bypass the cache.
  • Prices and stock stay right: a price change, a stock change, a scheduled sale or an order clears the product and the shop and category pages that list it.
  • Forms keep working: pages expire after ten hours at most, inside the lifetime of WordPress’s security tokens.

Knows when to stay off

If your host already caches your pages, if Varnish or LiteSpeed caches the site, or if another cache plugin is caching your pages, Gorilla Cache stays off, writes nothing, and tells you why in one sentence. Two caches on top of each other cause problems.

Safe on staging copies

Copy your site to staging, sync it back, or move it to a new domain or server: on the first request there, Gorilla Cache notices, clears its cache once and starts fresh, so a copy never shows the live site’s pages or the other way round. It tells you once, quietly, says when the site looks like a staging or development copy, and offers to turn caching off there. It never asks Cloudflare to clear anything from a copy.

One switch on the Status tab turns caching off on any site, and back on. While it is off, the admin bar shows “Gorilla Cache off” in red on every screen, so it is never off without you knowing.

Explains itself

  • One screen shows whether caching is on and why, how many pages are cached, and what was found.
  • wp gorilla-cache explain <address> says whether a page is cached, and if not, why. Add ?nocache to any address to see it uncached.
  • Every page it handles carries an X-Gorilla-Cache header: HIT, MISS or BYPASS with the reason.
  • Clear cache from the admin bar or the Status tab; WP-CLI commands for agencies.

Caching only

Gorilla Cache does not minify, combine or delay CSS and JavaScript, lazy-load images, preload fonts, rewrite to a CDN or clean the database. Those are optimisation, and doing both in one plugin is where sites break. Use an optimisation plugin beside it: with the common ones, Gorilla Cache stores each page as that plugin finished it.

Privacy

Gorilla Cache itself makes no requests to outside services, sets no cookies on your visitors and stores no personal data. The only requests it makes are to your own site, to warm the cache and to check for other caches in front of it. When the Cloudflare plugin is active, Gorilla Cache asks that plugin to clear Cloudflare’s copy of a page when its own copy is cleared; the Cloudflare plugin sends that request, with its own settings.

Screenshots

Installation

  1. In WordPress, go to Plugins > Add New Plugin, search for “Gorilla Cache” and click Install, or upload the plugin zip.
  2. Activate it. Your site is cached, unless your host or another plugin already caches it; nothing else to do.
  3. Optional: open Settings > Gorilla Cache to see what it found, or to add your own exceptions on the Advanced tab.

FAQ

Do I need to configure anything?

No. Store pages, logged-in visitors, carts and forms are handled automatically. The Advanced tab is there if you want to add your own exceptions.

Why is Gorilla Cache not caching my site?

The Status tab gives the reason in one sentence. Usually another cache already does the job: your host, Varnish, LiteSpeed or another cache plugin.

Is my WooCommerce or Easy Digital Downloads store safe?

Cart, checkout and account pages, and visitors with something in their cart, are never served from the cache. Pages are found from your store’s settings, whatever they are called. Price and stock changes clear the product and the pages that list it.

How long are pages cached, and why ten hours?

Ten hours by default. WordPress’s form and checkout security tokens are valid for at least twelve hours, so cached pages never outlive them.

What does Gorilla Cache not do?

Minifying, removing unused CSS, delaying JavaScript, lazy loading, preloading fonts, CDN rewriting and database cleanup. These are optimisation, not caching.

Does it work with optimisation plugins?

Yes, with the common optimisation plugins: Gorilla Cache stores each page after that plugin has changed it. Another plugin that changes the whole page after WordPress has built it keeps those pages out of the cache, because Gorilla Cache would store a page visitors never see; the Status tab names that plugin. When an optimisation plugin’s own page cache is on, Gorilla Cache stays off and says so; when a plugin sends a header on every page that forbids caching, the Status tab names it and asks you to turn off one of the two.

I use Cloudflare. Is that a problem?

No. If Cloudflare also caches your pages, Gorilla Cache tells you, and clears Cloudflare’s copy through the Cloudflare plugin when it is active.

I copy my site to staging and back. Does the cache get mixed up?

No. Gorilla Cache remembers the address and install it caches for, in your own database only. After a copy, a sync in either direction or a move, it clears its cache once and starts fresh, so no page from the other copy is shown, and it tells you so. On a staging or development copy you can turn caching off with one switch; that stays with the copy and never reaches the live site.

Does it work on multisite?

It works on single sites. Activation is refused on a multisite install.

What is removed when I deactivate or delete it?

Deactivating removes its line from wp-config.php, its advanced-cache.php and its cached files. If another cache plugin’s advanced-cache.php has taken over and needs that line, the line stays. Deleting also removes its settings. It never changes other plugins’ files, except leftovers whose only effect is to keep caching off: when it turns caching on, it replaces an empty advanced-cache.php another cache plugin left behind, or the one of a cache plugin you have deleted (keeping a copy), and removes a define( ‘WP_CACHE’, false ); line another cache plugin left in wp-config.php. The file of a cache plugin that is only switched off is replaced when you click Replace it with Gorilla Cache’s.

How do I report a security issue?

Please do not post it in the support forum. Report it privately as our security policy describes.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Gorilla Cache” is open source software. The following people have contributed to this plugin.

Contributors

Translate “Gorilla Cache” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.0.1

  • Security hardening: the settings screen and the links that turn caching off and on check their own security code and your rights in one place, before anything else.
  • Security hardening: every request value the page cache reads is checked before use; a request with a control character or an address over 8 KB is left uncached.
  • Requires WordPress 6.9. The page cache no longer opens an output buffer of its own: it stores each page from WordPress’s own (the template enhancement output buffer). When a known optimisation plugin wraps it, the page is stored as that plugin finished it; when another plugin would still change the page afterwards, the page is not cached and the Status tab and wp gorilla-cache explain name that plugin.
  • Folders are found through WordPress’s own functions instead of its constants. Sites updating from 1.0.0 keep their cache and a pause.
  • Security hardening: the settings form is read only on its own save, so other screens’ saves are never checked against it.
  • Files are written through WordPress’s file functions, except two steps they do not offer: replacing a file in one step and editing wp-config.php under a lock.
  • Security hardening: a page built for a tracking link (utm_, gclid and similar) is no longer stored; such links are answered from the plain address’s cached copy.
  • Security hardening: an address keeps at most 50 copies by parameter, and an encoded value shares its plain value’s copy.
  • The Status tab warns about WooCommerce Multilingual whenever its multi-currency is on.
  • The admin bar’s red dot (caching off) is centred on its text.
  • Scheduled tasks that went missing (warming, the hourly clean-up, the daily check) are put back automatically; warming no longer says “starts in the background” when no run is scheduled.
  • A page that cannot be stored (it sets a cookie, redirects, or sends a header that forbids caching) is no longer reported as about to be stored: warming counts only pages it stored, wp gorilla-cache explain names the reason, and the Status tab says so when most pages cannot be cached.
  • Another cache plugin’s leftover advanced-cache.php no longer keeps Gorilla Cache off for good: it is replaced with a click when that plugin is switched off, and by itself when that plugin has been deleted (the old file is kept). New: wp gorilla-cache check –replace-dropin.
  • A Gorilla Cache advanced-cache.php copied from another install (a staging sync) now loads this install’s own engine and settings, and the hourly clean-up rewrites it; before, that site cached nothing until an administrator opened an admin page.
  • Accessibility: the help text of each ? is read by screen readers, Escape closes it, and on a touch screen the first tap shows it and a second opens the guide.
  • Cloudflare: the Status tab says what a clear does there (from the Cloudflare plugin’s own settings: signed in, APO, Auto Purge), and after a clear the notice, Last cleared and wp gorilla-cache clear say “Cloudflare purge requested”.
  • After you save settings that clear the whole cache (your theme’s, an optimisation plugin’s, the Customizer), the next screen says so once; the Clear cache button no longer adds a parameter to the address.
  • An optimisation plugin’s own page cache is recognised (Gorilla Cache stays off and names it), and a Cloudflare edge cache setting that forbids caching on every page is named on the Status tab with what to do.
  • A live site on a .co.uk, .com.au, .co.za or similar address whose domain holds a word such as demo, local or test is no longer taken for a staging copy after a move or sync.
  • The Status tab’s heading says in a few words what is true now (“Visitors get your pages from the cache.”, or that the cache is still warming), with its sign level with the heading.
  • Security reports: the Help tab and this readme link to our security policy (gorillaplugins.com/security/). A click on a help icon no longer leaves a focus ring; keyboard focus still shows it.
  • The Status tab and wp gorilla-cache status say when WordPress’s scheduled tasks (WP-Cron) have not run for over two hours.

1.0.0

  • First release.
  • Page caching that sets itself up: cart, checkout, account and member pages are found from your plugins’ own settings and never cached.
  • Stays off, and says why, when your host, Varnish, LiteSpeed or another cache plugin already caches your pages.
  • Clears the right pages when you publish, update, change a price or stock, or change your design, and warms the cache in the background.
  • Starts fresh after your site is copied, synced or moved, and says when a site looks like a staging copy.
  • One Caching switch turns caching off on any site; while it is off, the admin bar says so.
  • The Status tab, the admin bar, WP-CLI and the X-Gorilla-Cache header say what is cached and why.