I'm currently using APC cache module on my PHP installation . The problem is that whenever I publish a new post , Users must use Ctrl + f5 to see new posts . Is there any way to purge APC cache automatically after a new post is published on Wordpress ?

  • Stop using APC. It's a complete piece of garbage. – Michael Hampton Oct 23 '15 at 15:37

WP has a plugin to work with APC, but it hasn't been updated in a long time, AFAIK. We use WP Super Cache instead, mostly because it only requires rewrite rules and gives us more flexibility to tell what's gonna be cached and what's not. Have you tried it?

Edit for @sajjad hosseini: Since you want to stick with APC, you could hack WP creating a plugin, or in a dirty way, call apc_clear_cache() and apc_clear_cache('user') inside the wp_insert_post() function defined at wp-includes/post.php. The problem is that you probably are going to have problems when updating your WP installation, since it'll perhaps overwrite the post.php file...

  • I'm trying to figure out a way to solve my APC issues . I know there are many options but that's not what I'm looking for . – sajjad hosseini Oct 23 '15 at 14:40
  • @sajjadhosseini, just updated my answer. Check it out. – Stefano Martins Oct 23 '15 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.