A very interesting problem occurred with one of the clients’ sites. Despite the use of the caching plugin, the first load of any page on the site occurred without caching (cache does not work on first load, caching error).
When checking the issue, we found out that when the WordPress site is loaded for the first time, the uncached version of the page is actually loaded. On subsequent page refresh or switching to the internal pages of the site, the caching plugin worked correctly, the cache was loaded, and the loading was fast. That is, at first, the caching plugin did not work at all. Some advanced plugins may even notify that the DONOTCACHEPAGE constant is active, but you won’t be able to find it in standard places.
The reasons for this behavior of the caching plugin may be different; in this particular case, the customer explained that shortly before the issue was detected, he added another language version of the site using the Polylang plugin. This is exactly what we proceeded from.
As a result, our suspicions were confirmed, the Polylang plugin function “Detect browser language” was activated on the site, in the description of which it is written: “As this doesn’t work if it is cached, Polylang will attempt to disable the front page cache for known cache plugins.”
To restore the normal operation of caching on the site, you must:
- Disable the function of the Polylang plugin “Detect browser language”.
- Open the settings of the previous item “URL Modifications” and click the “Save changes” button.
- Clear the cache in your caching plugin.