• I tried looking into the code to identify the proper code to execute a command to delete the cache for the homepage. I believe the proper place to put this code would be during the ‘wp_cache_post_edit’ or ‘wp_cache_post_change’ functions within ‘wp-cache-phase2.php’. Everything I have tried has failed, so looking for guidance.

    I know I can check ‘Clear all cache files when a post or page is published or updated.’ in the settings, but I am not looking to clear all cache I just need to clear the homepage upon editing a single post.

    Any help would be greatly appreciated.

    TIA

    https://www.ads-software.com/extend/plugins/wp-super-cache/

Viewing 6 replies - 1 through 6 (of 6 total)
  • When you edit or publish a page or post the homepage is cleared and the post itself. You shouldn’t need to clear it manually.

    Thread Starter klint01

    (@klint01)

    Unforunately, I am not experiencing completely. Here are the steps that are taking place and why I am asking.

    I have a front-end form for users to submit posts to the site.
    Step 1) wp_insert_post is executed with post_type = ‘draft’
    Step 2) the image they associate with the post is processed (media_handle_upload) and attached to the post_id.
    Step 3) wp_publish_post is executed for the post, which puts it in published status
    Step 4) wp_update_post is executed for the post, which then triggers another plug-in (network-publisher) to publish the post to social sites with the image.

    I have found that super_cache works perfectly if the post_type is ‘publish’ with step 1, but with Step 4 it is not clearing the home page. I don’t see the post on the home page until the expire time hits.

    Thanks.

    When you publish the post it should clear the cache. It’s odd that it isn’t. Does the plugin error log show anything?

    Thread Starter klint01

    (@klint01)

    Where is the plugin error log, because I am not seeing an error log file for this plugin. The site error log shows nothing.

    Like I said before, it works fine for wp_insert_post, but wp_publish_post is not causing the homepage to clear. Per the debug effort I have done, I can see that it clears the specific post, but not the homepage.

    There’s a “Debug” tab when you go to the plugin settings page. Enable the log there.

    What are you using for the homepage? A page or the normal WordPress archive?

    Thread Starter klint01

    (@klint01)

    Upon submitting their post (from the front-end), they are redirected to the homepage (index.php of the theme).

    Here are the results of the debug file:
    ** With Clear all cache files when a post or page is published or updated SELECTED. **
    06:57:10 /foodfrenzy/ wp_cache_shutdown_callback: collecting meta data.
    06:57:10 /foodfrenzy/ Writing meta file: /home/xxxxx/public_html/foodfrenzy/wp-content/cache/meta/wp-cache-335a2832d4cc99997afd5c189959dfc8.meta

    ** With Clear all cache files when a post or page is published or updated NOT SELECTED. **
    06:57:53 /foodfrenzy/submit-post/ Clearing cache for post 10042 on post edit.
    11:57:53 /foodfrenzy/submit-post/ Clearing cache for post 10042 on post edit.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: WP Super Cache] Clear ONLY is_home in cache upon edit/update of a post’ is closed to new replies.