New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache recreated on each page load #2156
Comments
Another case, fixed with the wp-config modification above |
@piotrbak If you remember, could you please add the Steps to reproduce section? |
@GeekPress For Cloudflare it was resolved in our add on, I believe:
|
From the dev team, it still needs to be fixed: |
@piotrbak Then, I re-ask the question about the Steps to reproduce 😇 |
@GeekPress Done |
@piotrbak Awesome, thanks 🤚 |
When the initial cache file is created, is it using the I'm failing to see how it can happen, all the methods reading and writing use the same method |
Another case (fixed per above): https://secure.helpscout.net/conversation/1221685493/179588/ |
Thank you for reporting this. 👆 In this case, The issue was resolved by adding the following in the
The initial file is |
@arunbasillal This all seems to come from a misconfiguration on the server side, WP Rocket is behaving as expected based on the configuration provided. I don't think we can do anything to fix this automatically, the issue is happening even before the plugin starts to do its work. |
@Tabrisrp Thanks for your feedback. Thinking out loud. Why do we need to add |
When the site is using HTTPS but
$_SERVER
array values are wrongly set to HTTP and port 80 (it can happen with Cloudflare flexible SSL for example), the cache is recreated on each page load.It happens because
$cache_filepath
points to theindex.html
file instead ofindex-https.html
:wp-rocket/inc/classes/Buffer/class-cache.php
Line 93 in 281eb49
When it's related to Cloudflare (haven't seen it happening on other proxies), setting values of the array in wp-config.php file resolves the problem:
if ( isset( $_SERVER["HTTP_X_FORWARDED_PROTO"] ) && $_SERVER["HTTP_X_FORWARDED_PROTO"] == "https" ) { $_SERVER["HTTPS"] = "on"; }
Steps to reproduce:
or
Related tickets:
https://secure.helpscout.net/conversation/1005343810/131288/
https://secure.helpscout.net/conversation/1019496418/134235?folderId=1213662
The text was updated successfully, but these errors were encountered: