Caching plugins and CDNs
On this page
Tools that speed up your site can get in the way. They change files, delay scripts or keep old copies. Three problems come up.
1. Files rewritten on the way#
Every translation file is checked against a checksum. A tool that minifies, combines or rewrites JSON changes the bytes. The loader then refuses the file, and the page stays in the original language.
Exclude the translation file paths from minify, combine and optimise features. On WordPress the files are under wp-content/uploads/resilientlang/. On a CDN they are under /v1/<site key>/.
2. The script is delayed or changed#
Features that defer, delay or combine scripts can break the loader or load it late. Exclude the loader script, or switch the feature off for it. If the loader loads late, the flash of original text is longer. See Flash of untranslated text.
3. An old manifest#
The manifest is meant to be cached for about a minute. A cache that keeps it for hours delays every new publish. Set the manifest path to a short cache or to no cache. The language files themselves have a fingerprint in their name, so they can be cached for a long time.
Whether a given tool rewrites JSON files or delays scripts depends on its settings and version, so check its documentation: verify.
Page caches and language#
Language addresses such as /fr/ are different addresses, so page caches keep them apart without any setting. Check that your cache does not serve one language's page at another language's address.
After a publish, the plugin copies new files on its next sync. Press Sync now to see a change at once. Then clear the page cache if the translated pages are cached with the old text.
How to test#
Open the site in a private window with the browser tools open. Check that the translation file is fetched with status 200 and is not served from an old cache. Then check that the page changes.