=== Thorakis Cache ===
Contributors: thorakis
Tags: cache, performance, speed, page cache, optimization
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Page caching with nothing to configure. It serves your pages from disk, keeps itself up to date, and removes itself cleanly.

== Description ==

Thorakis Cache saves each page once and then serves it straight from disk, without going through WordPress or the database.

It is built to be installed by somebody who does not want to learn what a cache is.

= What it does =

* **Nothing to configure.** One button to turn it on, one to clear it. Everything else is worked out from your site.
* **It keeps itself up to date.** Publishing a post, switching themes, editing a menu or a widget clears what needs clearing, without you thinking about it. Editing one post only clears the pages that showed it, not the whole site.
* **It never serves a page to the wrong person.** As soon as a visitor carries any cookie the plugin does not recognise, their page is served normally instead of from the cache. Fewer pages accelerated, but never mixed-up content.
* **It calls no outside server.** No data leaves your site. No sign-up, no key, no account.
* **It works on multisite networks**, with each site keeping its own cache, its own settings and its own records.
* **It removes itself completely.** On uninstall, not one option and not one file is left behind.

= What else it speeds up =

* **Compressed ahead of time.** Each page is saved compressed at the same moment it is cached. The server has nothing left to compress on the fly, and the visitor receives three to five times fewer bytes.
* **Pages prepared in advance.** After a clear-out, the plugin rebuilds the most visited pages while you work in the admin, so no visitor pays for the rebuild.
* **The next page, fetched early.** The browser quietly prepares the page a hovered link points to. Navigation feels instant.
* **Painting without waiting for stylesheets.** An analysis — run in your own browser — finds the styles used at the top of your pages and writes them straight into them; the rest stops blocking. Measured on common themes: four fifths of a stylesheet is not needed for the first screenful.
* **Third-party scripts deferred** until the visitor's first interaction, at the highest optimisation level.
* **Oversized images pointed out.** The plugin does not touch your images — it shows you which ones are sent far larger than they are displayed, with their real weight. Only you can see it.

= If something looks wrong =

Clear the cache: in the vast majority of cases that is enough. If the problem stays, deactivate the plugin — your site goes straight back to normal, with nothing lost.

There is also an exclusions field, so you can set one page aside without giving up the rest.

= Compatibility =

Thorakis Cache refuses to turn on if another caching plugin is already in place, and tells you which one. Two caches stacked on top of each other break one another; a clear refusal beats an obscure failure.

= What it changes on your server =

Turning the cache on adds one line to your `wp-config.php` and creates a `wp-content/advanced-cache.php` file. That is how WordPress knows a cache is present — it is the standard mechanism, used by every page-caching plugin. Both are removed when you turn the cache off, and if `wp-config.php` is not writable the plugin shows you the exact line to add yourself.

== Installation ==

1. Install and activate the plugin.
2. Go to **Settings → Thorakis Cache**.
3. Click **Turn the cache on**.

== Frequently Asked Questions ==

= Do I need an account or a key? =

No. The plugin runs entirely on your server and contacts nothing outside it.

= Do logged-in visitors see cached pages? =

No. Anyone logged in — and more generally any visitor carrying a cookie the plugin does not recognise — gets a fresh page.

= What about my WooCommerce shop? =

Baskets and checkout rely on session cookies: those pages are never served from the cache.

= Why does my cache not seem to speed anything up? =

Most often, a plugin on your site sets a cookie for every visitor, which prevents any caching. The settings screen names exactly what is getting in the way, when it can see it.

= What is "Show the page without waiting for styles"? =

Your browser refuses to show anything until it has received every stylesheet. The analysis finds the styles used at the top of your pages, writes them straight into them, and lets the rest load without blocking.

It runs **in your own browser**: the plugin opens a few representative pages in hidden frames and measures. Nothing is sent anywhere.

If a page looks wrong afterwards, one button removes the optimisation and your stylesheets go back to normal immediately.

= Do I have to run that analysis again? =

The plugin takes care of it: as soon as you switch theme, activate a plugin or save a customisation, it drops the analysis that has become wrong and tells you. It does not re-run it by itself, because the analysis opens your site in your browser.

= Are stylesheets hosted elsewhere optimised? =

No, and that is deliberate. Your browser is not allowed to read the contents of a stylesheet from another domain. Rather than routing them through a middleman, the plugin leaves them as they are and names them for you.

= Can I use it on a multisite network? =

Yes. Each site of the network keeps its own cached pages, its own settings, its own freshness and its own records. Clearing the cache on one site does not touch the others.

= What happens if I delete the plugin? =

The `advanced-cache.php` file, the line added to `wp-config.php`, every option and the whole cache on disk are removed. On a multisite network, for each of the sites.

== Screenshots ==

1. The settings screen. One button turns the cache on, one clears it. Everything else on this page explains what is happening — there is nothing else to set.
2. The dashboard widget: whether the cache is on, how much time it saves, and how many pages are stored.

== External services ==

This plugin does not connect to any external service. It sends no data anywhere,
it has no licence key, no account, no telemetry and no update server of its own.

Two points are worth stating plainly, because an automated scan of the source
can suggest otherwise.

**Requests the plugin does make.** The only HTTP requests are loopback requests
to your own site, at the address returned by `home_url()`. They are used for two
things: measuring how long a page takes to build, so the settings screen can show
what the cache is saving, and fetching pages again after the cache is cleared so
the first real visitor does not pay for the rebuild. These requests never leave
your server, and no third party is involved.

**Why third-party domain names appear in the source.** The file
`src/Optimisation/ThirdPartyScripts.php` contains a list of host names such as
`googletagmanager.com`, `connect.facebook.net` and `intercom.io`. That list is a
matching list, not a set of endpoints. If your own pages already load a script
from one of those hosts, the plugin holds it back until the page has been drawn,
then lets it run. The plugin never contacts those hosts, sends them nothing, and
adds no script that was not already on your page. Remove the third-party script
from your site and the plugin has nothing to defer.

== Changelog ==

= 1.0.0 =

First public release.

* Pages served straight from disk, without WordPress or the database.
* Nothing to configure: one button to turn it on, one to clear it.
* Automatic invalidation — editing a post clears only the pages that showed it, not the whole site.
* Never serves a cached page to anyone logged in, or carrying a basket or a session.
* Compression prepared ahead of time, gzip and brotli where the server allows it.
* Pages rebuilt in the background after a clear-out, without relying on cron.
* The next page fetched early, as soon as a visitor shows they are about to click.
* Painting without waiting for stylesheets, analysed in your own browser — nothing is sent anywhere.
* Third-party scripts deferred until the visitor's first interaction.
* Oversized images pointed out, so you can replace them.
* Multisite networks supported, each site fully separated from the others.
* No outside calls of any kind. Complete uninstall.
