Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 798 forks source link

On comment: too much stuff is deleted #25546

Open finzend opened 7 years ago

finzend commented 7 years ago

Hello, using WP 4.7.3, WPSC 1.4.9

The problem is similar to Automattic/wp-super-cache#169 but now its happening when commenting (not when updating/posting). ALL the cache is deleted when someone posts a comment. I have used the filter wpsc_delete_related_pages_on_edit to return 0, to disable deleting homepage and other pages. But that only works for post updates. Not for comments?

I have uncommented the prune_super_cache function, and replaced it by a debug message, because else the log would be deleted every time... Here a snippet from my log:

10:55:25 27836 /wp-comments-post.php wp_cache_post_change: not deleting all pages. 10:55:25 27836 /wp-comments-post.php wp_cache_post_change: not deleting front static page. 10:55:25 27836 /wp-comments-post.php wp_cache_post_change: checking /httpdocs/wp-content/cache/blogs/blog/meta/ 10:55:25 27836 /wp-comments-post.php wp_cache_post_change: Already processed post 90323. 10:55:25 27836 /wp-comments-post.php DEBUG: prune_super_cache ( /httpdocs/wp-content/cache/.htaccess, 1, ) 10:55:25 27836 /wp-comments-post.php gc: could not delete /httpdocs/wp-content/cache/.htaccess as it's protected. 10:55:25 27836 /wp-comments-post.php DEBUG: prune_super_cache ( /httpdocs/wp-content/cache/blogs, 1, ) 10:55:25 27836 /wp-comments-post.php gc: could not delete /httpdocs/wp-content/cache/blogs as it's not empty: index.html 10:55:25 27836 /wp-comments-post.php DEBUG: prune_super_cache ( /httpdocs/wp-content/cache/index.html, 1, ) 10:55:25 27836 /wp-comments-post.php gc: could not delete /httpdocs/wp-content/cache/index.html as it's protected. 10:55:25 27836 /wp-comments-post.php DEBUG: prune_super_cache ( /httpdocs/wp-content/cache/xxxxx.txt, 1, ) 10:55:25 27836 /wp-comments-post.php DEBUG: prune_super_cache ( /httpdocs/wp-content/cache/supercache, 1, ) 10:55:25 27836 /wp-comments-post.php gc: could not delete /httpdocs/wp-content/cache/supercache as it's protected. 10:55:25 27836 /wp-comments-post.php Post 90323 changed. Update cache. 10:55:25 27836 /wp-comments-post.php wp_cache_post_change: Already processed post 90323. 10:55:25 27836 /wp-comments-post.php Not caching POST request. 10:55:25 27836 /wp-comments-post.php wp_cache_maybe_dynamic: returned $buffer

Is there a reason this is happening?

Any help appreciated.

DrLightman commented 7 years ago

The log should be generated outside the cache directory, under /wp-content/ in my install, not in /wp-content/cache/ or /supercache/, therefore it never should get deleted by wpsc functions like prune_super_cache(). Are you sure you've got your paths right?

finzend commented 7 years ago

Thanks for your reply. The path is httpdocs/wp-content/cache/ so that should be ok? The log is saved in that folder, not in wp-content. It also states that in the plugin Debug-options: "It can log them to a file in your cache directory."

PS: I use a multisite installation of WP.