I have a problem with Cloudflare not being able to cache my site to reduce the # dynamic requests.
Apparantly it is both the hosting plugin and WPML plugin that block cache in the headers. We have tried to inactive the plugins on a test page and then the cloud flare cache works fine.
When loading the page with plugin WPML installed the Cache-control Response headers are set for no cache, if we disable the plugin the headers are OK (Cloudflare cache works). When these headers are present the cloudflare cache does not work so we need to prevent them from disabling the cache. How can we solve this?
To provide you with the quickest and most accurate support, please provide your debug information. You can find it in WPML > Support > click on the "Debug information" link. For more information, you can visit this link: http://wpml.org/faq/provide-debug-information-faster-support/
As far as I know, WPML does not control the "Cache-Control" HTTP header. However, I conducted some tests on a test site with a cache plugin and WPML installed. From my observations, the site only sends the "Cache-Control" response header with the value "no-cache" when logged in as an admin. When testing the site while logged out, I did not see "no-cache" set for the "Cache-Control" header. This behavior seems to be normal and should not cause any cache issues.
Could you please check and verify, if the "no-cache" cache-control is set on your site when logged out or for normal users also? if that is the case then it might be an issue.
You mentioned that the issue is resolved when you deactivate WPML. Is my understanding correct? If you are testing this, please ensure that you load a few pages and allow the site to cool down and build its cache after deactivating WPML before verifying the results. Additionally, you mentioned that this issue is related to a "hosting plugin." Does it get resolved only when you deactivate both the hosting plugin and WPML, or does deactivating either one of them solve the problem?
If you need further assistance, I will need to examine your site in more detail. Could you please provide me with the URLs on your site where I can see the "Cache-Control" response header set to "no-cache"?
This is happening for logged out users - the headers that are being set when WPML plugin is activated are:
no-store,no-cache,must-revalidate
Please see attached video, its from local test enviroment but is the same on live with logged out user (we can't disable on live enviroment because it would break the site).
1. WPML plugin is activated - we visit the page (logged out) and look at the response headers
no-store,no-cache,must-revalidate is set
2. WPML plugin is deactivated (with wp cli)
3. We visit and reload the page again - the headers no-store,no-cache,must-revalidate is not set in response headers
The URL of my site is hidden link and then you can see for example as per pictures URL hidden link
I hope this information helps to further investigate what the issue might be.
First of all can you please try updating WPML plugins to the latest version from wp-admin -> Plugins -> Add New -> Commercial ( tab at the top ) and see if it helps? Also, if possible please try upgrading PHP to the new version 8.X and see if it helps.
On your live site yes, I see the header set to "max-age=0,no-cache,s-maxage=0" which I was not able to see on a test site so probably this is an issue only on your site and not with general WPML, due to some interference from third-party plugin/theme/code on your site.
I see you were testing on a local environment, is the issue on your site there even with normal setup without Cloudflare? If yes can you please test the following and see if it helps finding the cause of the issue:
- Deactivate all plugins except main WPML plugin on your test local site.
- Activate a default theme like twenty twenty three.
- Now see if the issue is still there or not.
- If not please activate original theme and plugins one at a time to see which one starts the issue.
If it still happens only with WPML plugin activate and a default theme we will need to troubleshoot the issue further. As explained in the document linked next will it be possible for you to provide a site copy for us to test it further? https://wpml.org/faq/provide-supporters-copy-site/
I have enabled a private reply for you to share the details securely.
Regards,
Subash
The topic ‘[Closed] I have a problem with Cloudflare not being able to cache my site to reduce the # dynamic requests.’ is closed to new replies.