Caching plugins on a translated site: LiteSpeed, WP Rocket
WP Provider Translate works with the common WordPress caching plugins, including LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache and SiteGround Speed Optimizer. You don’t need to change their settings. A page that still has text waiting for translation is kept out of the cache, and when its translations arrive or you correct one, the cached copy of that language’s page is cleared, so visitors see the new text.
How caching works with translated pages
- Each language is its own page. Every language has its own address (such as
/de/about/) or its own domain, and caching plugins store a page per address. One language’s page is never shown for another. - Half-translated pages are not cached. While a page has text that is not translated yet, WP Provider Translate tells caching plugins not to store it. As soon as it is complete, the cache can keep it as usual.
- Changes clear the right pages. When translations for a page arrive, when you correct a translation, and when you save a post, that page’s language versions are cleared from the cache. Your caching plugin already clears the original page on save; this takes care of the translated ones.
LiteSpeed Cache
LiteSpeed Cache does not store a page that still has untranslated text. When translations arrive or are edited, and when you save a post, LiteSpeed Cache clears the page in each language.
WP Rocket
WP Rocket does not store a page that still has untranslated text. When translations arrive or are edited, and when you save a post, WP Rocket clears the page in each language.
W3 Total Cache
W3 Total Cache does not store a page that still has untranslated text. When translations arrive or are edited, and when you save a post, W3 Total Cache clears the page in each language.
WP Super Cache
WP Super Cache does not store a page that still has untranslated text. When translations arrive or are edited, and when you save a post, WP Super Cache clears the page in each language on your main domain. If a language has its own domain, clear WP Super Cache yourself after correcting a translation.
SiteGround Speed Optimizer
When translations arrive or are edited, and when you save a post, SiteGround Speed Optimizer clears the page in each language.
Other caching plugins and server caches
Other caches, including caches run by your host, get the standard “do not cache” signal for a page that is not fully translated. A cache that respects it does not store a half-translated page.
These caches are not cleared automatically when a translation changes. After you correct a translation, clear that cache yourself (or wait until it expires) to see the change.
WP Provider Translate’s own cache
WP Provider Translate also keeps its own copy of every finished translated page, so a page is translated once and then served quickly. It works next to your caching plugin and needs no setup:
- Only complete pages are kept.
- A change to the original is noticed at once: the stored copy only matches the exact page it was made from.
- A page that changes on almost every visit (for example one with a counter or a “3 minutes ago” time) is not kept for a day once it has changed 3 times within 10 minutes. It is still shown translated.
- Copies older than 7 days are removed.
Logged-in views, the result of a form someone sent, and the live translation editor are never cached.
Troubleshooting
- A correction doesn’t show on the site. If you use one of the caching plugins above, the page is cleared for you; reload it. With another cache, or with a CDN, clear that cache. Also check that you are looking at the right language address.
- A page shows in the original language for a while after I publish it. New text is translated in the background, and the page is not cached until it is complete. See How translation runs.
- The language switcher doesn’t appear after I added it. Clear your caching plugin’s cache once, so the pages are built again with the switcher. See Language switcher in the menu.
For developers
- The
wppt_purge_urlsaction receives the addresses of language pages whose translations changed or whose post was saved. A cache that is not cleared automatically can listen to it. wp wpprovider-translate statsshows the state of the built-in cache.
Details in Developer filters and actions and WP-CLI commands.