-
Notifications
You must be signed in to change notification settings - Fork 211
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
Page integrity is not checked when putting buffer to cache file #1883
Comments
That's interesting, I don't think it's something that came up before. There is a reason we don't stop caching if there is no closing But there could still be some additional checks to make sure the whole HTML content is there when caching a normal page. |
@Tabrisrp Now I understand, why there was no such check, thank you. It woud be nice to have some solution before next update, or I will get my bug back :) |
@arunbasillal This has not been fixed properly, please read on :) Your recent implemented fix, reports issues of missing ,,wp_footer() to the admin user. But the issue @leurdo experienced, which we are also experiencing on multiple customers is much more important. During a cache load, somehow WP Rocket/WP is interrupted, but WP Rocket still saves the cache. We are implementing @leurdo 's fix on every customer to prevent this.. |
@JeppeKr Thanks for the feedback. This issue isn't closed yet as you can see. I will look into this and consider this for an upcoming major version :) |
Describe the bug
My site has some 300K pages, it is very old, and without cache page load is very slow. So, I noticed that sometimes pages are not loaded to cache completely. This means that html in cached file is broken (half of page is missing). I think that due to some timeout or when the page load is extremely slow, page is not loaded completely. And this may happen, that such page version can go to cache.
Apart from load speed problems on my site, the problem is, that page integrity in buffer is never checked.
Here is part of your function maybe_process_buffer from class-cache.php
$is_html reflects html integrity but is not used to stop caching if there is no closing tag.
Expected behavior
You could prevent uncomplete $buffer from caching as following:
I tried this solution on my site, and now I am getting no more broken pages.
Of course, there could be more elegant solution, because you know your code better than I do.
The text was updated successfully, but these errors were encountered: