Skip to content

Caching

How SimpleMath Captcha interacts with page caching, and what to exclude from external caches.

Updated 1 min read

A session-bound captcha and a cached page are fundamentally in tension: a cached page hands every visitor the same challenge ID, and that ID lives in only one of their sessions. The plugin calls Joomla's allowCache(false) on the response whenever it renders a challenge, which tells Joomla's own page cache to leave that page alone.

Two things follow from this:

  • Exclude the page from any cache Joomla doesn't control — a reverse proxy, a CDN, a

static-page plugin. Joomla's own flag has no reach into those.

  • Think twice before putting this captcha in a site-wide module (e.g. a footer). Every

page that renders it becomes uncacheable and creates a fresh session challenge. That's exactly right for a single contact-form page; it's usually the wrong trade-off for something shown in every page's footer. Consider putting such a form behind a link instead.

Each render creates a new challenge; old, unanswered ones are pruned by expiry and by the Challenges kept per session cap (see Advanced Settings), so a session's stored challenges can't grow without bound.

Image

Everything you need to build on Joomla — one subscription away.

Resources