Clear cache when a post is submitted

I have a question.

How can I clear the cache when a post is submitted ?
Actually, I need to clear two speficied pages which display these articles ?
By default, I have noticed the index.php is cleared automatically when a post is submitted.
But not Archive page or Category page

Read More

Thanks in advance.

EDIT :
By the way, how to clear only a specific page with W3 Total Cache ?

Example : Clear /blog.php

Related posts

Leave a Reply

1 comment

  1. Hm, I am not sure but I think that whole cache should be invalidated on publishing of new post… Had you tried to enable debug info in W3TC and check why are those pages aren’t refreshed?

    As for manual cache clear, from plugin’s FAQ:

    How can I flush the cache without
    using the WP Admin interface?

    It’s possible to empty the entire
    cache or simply purge the cache of a
    single post / page:

    Purge the entire
    page cache:
    if
    (function_exists('w3tc_pgcache_flush'))
    { w3tc_pgcache_flush(); }

    Purge a
    single post / page by passing it’s ID:

    if
    (function_exists('w3tc_pgcache_flush_post'))
    { w3tc_pgcache_flush_post($post_id);
    }