Multilingual caching with WP Rocket and MULTIGURA

WP Rocket

MULTIGURA registers itself with WP Rocket as a translation plugin, through the same interface that WP Rocket uses for WPML and Polylang. WP Rocket then knows the languages of the site, keeps a separate cache for each of them and clears the right pages when content changes.

What it covers

  • A cache for every language, with the home page of each language
  • Clear cache per language in the admin bar, with flags
  • Clearing a saved post in its own language, together with its archives and the home page of that language
  • WooCommerce cart, checkout and account pages kept out of the cache in every language
  • Preload of the home pages of all languages and of the MULTIGURA sitemap

Content shown inside other pages

WP Rocket clears only the URL of a saved post and its archives. A form, a template or a section, however, appears inside other pages. When an item of a translatable type without a page of its own is saved (for example a Contact Form 7 form, an Elementor template, a Divi Library layout or an Avada section), MULTIGURA clears the whole cache at the end of the request, so the new translation shows everywhere.

Settings and texts

Saving the MULTIGURA settings or the text translations clears the whole cache. After a change of languages, WP Rocket rebuilds its configuration on the next request with the new languages.

Compatibility

  • WP Rocket 3.10 or newer, tested with WP Rocket 3.24.
  • Posts and products are cached too: their links end the way the permalink structure ends, as WP Rocket expects.

Setup

  1. Activate WP Rocket and MULTIGURA. The integration starts by itself.
  2. Clear the WP Rocket cache once after the activation.
  3. Use Clear cache in the admin bar to clear one language or all of them.

Frequently asked questions

Does each language get its own cache?

Yes. WP Rocket stores every language as separate files, and MULTIGURA tells it which URLs belong to which language.

Why is the whole cache cleared when I save a form?

A form or a template is shown inside other pages, and WP Rocket does not know which ones. Clearing the whole cache makes sure the new text appears everywhere.

Are cart and checkout pages cached?

No. The WooCommerce cart, checkout and account pages stay out of the cache in every language, not only in the default one.