Support » Plugin: W3 Total Cache » An unknown action purges my cache several times a day

  • Resolved erua97

    (@erua97)


    Good morning,

    First thank you for your really awesome plugin!

    I’m having problems with an unknown action that purges my cache regularly during the day, it’s very annoying since visitors have to load the page each time they visit.

    In the purge log (page cache) here is an extract of what (apparently) causes the purge: 

    Date
    
    Tue, 12 Sep 2023 10:03:42 +0000
    
    Action
    
    flush_post(53898)
    
    User
    
    Stack Trace
    
    #0
    
    wp-includes/class-wp-hook.php(312)
    
    W3TC\PgCache_Plugin--w3tc_flush_post (53898, null)
    
    #1
    
    wp-content/plugins/w3-total-cache/CacheFlush_Locally.php(160)
    
    do_action ("w3tc_flush_post", 53898, null, null)
    
    #2
    
    wp-content/plugins/w3-total-cache/Util_AttachToActions.php(116)
    
    W3TC\CacheFlush--flush_post (53898)
    
    #3
    
    wp-includes/class-wp-hook.php(312)
    
    W3TC\Util_AttachToActions--on_post_change (53898, {"ID":53898,"post_author":"0","post_date":"2023-09-12 12:03:42","post_date_gmt":"2023-09-12 10:03:..)
    
    #4
    
    wp-includes/post.php(4751)
    
    do_action ("save_post", 53898, {"ID":53898,"post_author":"0","post_date":"2023-09-12 12:03:42","post_date_gmt":"2023-09-12 10:03:.., false)
    
    #5
    
    wp-content/plugins/advanced-custom-fields/includes/acf-field-functions.php(1033)
    
    wp_insert_post ({"post_author":0,"post_content":"a:16:{s:4:\\\"type\\\";s:13:\\\"product_price\\\";s:12:\\\"instru..)
    
    #6
    
    wp-content/plugins/acf-frontend-form-element-pro/main/frontend/forms/classes/form-display.php(662)
    
    acf_update_field ({"ID":0,"key":"field_67d87fd2eebffa","label":"Prix","name":"fea_product_price","prefix":"","type":..)
    
    #7
    
    wp-content/plugins/acf-frontend-form-element-pro/main/frontend/forms/classes/form-display.php(1180)
    
    Frontend_Admin\Classes\Display_Form--render_fields ([{"label":"Titre du document","wrapper":{"class":" elementor-repeater-item-d6d8d21","id":"","width.., {"id":"elementor_67d87fd","ID":894,"parent_form":"","main_action":"","custom_fields_save":"product.., true)
    
    #8
    
    wp-content/plugins/acf-frontend-form-element-pro/main/elementor/widgets/general/frontend-form.php(736)
    
    Frontend_Admin\Classes\Display_Form--render_form ({"id":"elementor_67d87fd","ID":894,"parent_form":"","main_action":"","custom_fields_save":"product..)
    
    #9
    
    wp-content/plugins/elementor/includes/base/controls-stack.php(2223)
    
    Frontend_Admin\Elementor\Widgets\Frontend_Form--render ()
    
    #10
    
    wp-content/plugins/elementor/includes/base/widget-base.php(609)
    
    Elementor\Controls_Stack--render_by_mode ()
    
    #11
    
    wp-content/plugins/elementor/includes/base/widget-base.php(750)
    
    Elementor\Widget_Base--render_content ()
    
    #12
    
    wp-content/plugins/elementor/includes/base/element-base.php(447)
    
    Elementor\Widget_Base--print_content ()
    
    #13
    
    wp-content/plugins/elementor/includes/base/element-base.php(787)
    
    Elementor\Element_Base--print_element ()
    
    #14
    
    wp-content/plugins/elementor/includes/base/element-base.php(447)
    
    Elementor\Element_Base--print_content ()
    
    #15
    
    wp-content/plugins/elementor/includes/base/element-base.php(787)
    
    Elementor\Element_Base--print_element ()
    
    #16
    
    wp-content/plugins/elementor/includes/base/element-base.php(447)
    
    Elementor\Element_Base--print_content ()
    
    #17
    
    wp-content/plugins/elementor/core/base/document.php(1635)
    
    Elementor\Element_Base--print_element ()
    
    #18
    
    wp-content/plugins/elementor/core/base/document.php(1086)
    
    Elementor\Core\Base\Document--print_elements ([{"id":"7f8cb88","elType":"section","settings":{"layout":"full_width","content_width":{"unit":"px"..)
    
    #19
    
    wp-content/plugins/elementor/includes/frontend.php(1092)
    
    Elementor\Core\Base\Document--print_elements_with_wrapper ([{"id":"7f8cb88","elType":"section","settings":{"layout":"full_width","content_width":{"unit":"px"..)
    
    #20
    
    wp-content/plugins/elementor/includes/frontend.php(1006)
    
    Elementor\Frontend--get_builder_content (894)
    
    #21
    
    wp-includes/class-wp-hook.php(310)
    
    Elementor\Frontend--apply_builder_in_content (".h1.Vendre un Document./h1.\n.h1.Vendre un Document./h1.\n.ul.\n \t.li data-tab=\"\".Je dépose m..)
    
    #22
    
    wp-includes/post-template.php(256)
    
    apply_filters ("the_content", ".h1.Vendre un Document./h1.\n.h1.Vendre un Document./h1.\n.ul.\n \t.li data-tab=\"\".Je dépose m..)
    
    #23
    
    wp-content/plugins/elementor/modules/page-templates/module.php(190)
    
    the_content ()
    
    #24
    
    ()
    
    Elementor\Modules\PageTemplates\Module--print_callback ()
    
    #25
    
    wp-content/plugins/elementor/modules/page-templates/module.php(207)
    
    call_user_func ([{},"print_callback"])
    
    #26
    
    wp-content/plugins/elementor/modules/page-templates/templates/header-footer.php(19)
    
    Elementor\Modules\PageTemplates\Module--print_content ()
    
    #27
    
    wp-includes/template-loader.php(106)
    
    include ("/homepages/23/d877110921/htdocs/clickandbuilds/LeTrsortudiant/wp-content/plugins/elementor/module..)
    
    #28
    
    wp-blog-header.php(19)
    
    require_once ("/homepages/23/d877110921/htdocs/clickandbuilds/LeTrsortudiant/wp-includes/template-loader.php")
    
    #29
    
    index.php(17)
    
    require ("/homepages/23/d877110921/htdocs/clickandbuilds/LeTrsortudiant/wp-blog-header.php")

    At each of these purges, the log displays around ten similar actions (at the same time, only the post number is different). The above snippet involves post 53898 (flush_post(53898)) but I also have the same thing for posts 53897, 53896, 53895, up to post 53888.

    This is repeated several times during the day and the numbers of posts involved go up.

    I specify that the posts which are mentioned in this purge log do not exist (in any case were not created by me, and I am the sole administrator).

    I haven’t found what could be causing this.

    I installed WP Crontrol to try to find the cause but I couldn’t make any progress in that direction.

    Here are the crons present on my site (I should take advantage of this to clean up, yes…).

    w3tc_imageservice_cron
    action_scheduler_run_queue
    wf_scan_monitor
    jetpack_sync_cron
    jetpack_sync_full_cron
    somdn_delete_download_files_event
    w3_pgcache_prime
    wc_admin_process_orders_milestone
    wc_admin_unsnooze_admin_notes
    facebook_for_woocommerce_hourly_heartbeat_cron
    wordfence_hourly_cron
    wp_privacy_delete_old_export_files
    w3_pgcache_cleanup
    w3_objectcache_cleanup
    updraftplus_clean_temporary_files
    jetpack_clean_nonces
    googlesitekit_cron_update_remote_features
    w3_fragmentcache_cleanup
    wp_update_user_counts
    updraft_backup_database
    wordfence_daily_cron
    woolementor_daily
    w3_minify_cleanup
    fbrfg_check_for_updates
    woocommerce_cleanup_sessions
    jp_purge_transients_cron
    wp_session_garbage_collection
    fs_data_sync_acf-frontend-form-element
    woocommerce_scheduled_sales
    validate_woopay_compatibility
    wp_site_health_scheduled_check
    recovery_mode_clean_expired_keys
    wp_https_detection
    wp_version_check
    wp_update_plugins
    wp_update_themes
    ionos_assistant_cron_update_meta_cache
    ionos_assistant_cron_cleanup_expired_options
    wp_scheduled_delete 
    delete_expired_transients
    wp_scheduled_auto_draft_delete
    wc_admin_daily
    jetpack_v2_heartbeat
    facebook_for_woocommerce_daily_heartbeat_cron
    wc_connect_fetch_service_schemas
    wpseo-reindex
    wpseo_permalink_structure_check
    eael_remove_unused_options_data
    woocommerce_cleanup_personal_data
    woocommerce_tracker_send_event
    wpacu_daily_scheduled_events
    wordfence_start_scheduled_scan
    woocommerce_cleanup_logs
    woocommerce_cleanup_rate_limits
    fs_data_sync_unlimited-elements-for-elementor
    wppb_review_check
    wpacu_weekly_scheduled_events
    wordfence_start_scheduled_scan
    updraft_backup
    wp_delete_temp_updater_backups
    wordfence_start_scheduled_scan
    woocommerce_geoip_updater
    publish_future_post
    publish_future_post
    publish_future_post
    publish_future_post
    publish_future_post
    

    Would you know how to help me please? I’m not a coder or developer and so I quickly get lost and stuck.

    Could the problem come from something else?

    I can provide further information if necessary.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @erua97

    Thank you for reaching out and I am happy to help!
    The W3 Total Cache purges the post cache once the post is updated or a new post is created, and this behavior is managed by the Purge policy in Performace>Page Cache.

    SO it appears that something was updated on those posts, possibly automatically which causes :

    wp-includes/post.php(4751)
    
    do_action ("save_post", 53898,

    And this triggers the

    flush_post

    in the W3 Total Cache. Can you please share the Performance>Page Cache>Purge policy screenshot and possibly the website URL

    Thanks!

    Thread Starter erua97

    (@erua97)

    Hi Marko and thank you for your response!

    I’m sharing a screenshot below of my purge policy : https://snipboard.io/EB7lXz.jpg

    Please note though, I have tried unchecking everything but it keeps happening.

    The home page link is: https://letresoretudiant.fr/

    Also note that, as I have just visited this page as a visitor, the cache may still be active when you go to visit for yourself

    I remain at your disposal for further information.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @erua97

    Thank you for your feedback.
    The Frontend_Form widget acf-frontend-form-element-pro plugin, which updates some post while it renders itself. and it causes purge.

    You should check the post type of those posts by checking select * from wp_posts where post_id in (53898, other ids)
    high probability it’s some “cache storage” for the menditoned plugin.
    and it potentially can be filtered out from purging by post type.

    You may want to check this code in their github


    Thanks!

    Thread Starter erua97

    (@erua97)

    Hello @vmarko,

    Thanks again. I checked my posts table, all these posts are not present, the query tells me that all these posts do not exist.

    I dont know what to do…

    Regarding the code that you provided via Github, I really have very little knowledge of coding, so I admit that I don’t really know what to do with it.

    How to filter these “posts” from purging while they “don’t exist”? That’s a bit disturbing?

    Thanks again for your help Marko!

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @erua97

    Thank you for your feedback.
    This is why I mentioned that they may be in some cached areas other than W3TC.
    In the GitHub link, you can see the function
    public function flush_post_cache( $post) I would strongly suggest reaching out to acf-frontend-form-element-pro support and checking with them what may be occurring to call the post flush and if those posts are in some sort of cache.

    I hope this helps!

    Thanks!

    Thread Starter erua97

    (@erua97)

    I asked for help on this plugin’s forum.

    If I have something new and this thread isn’t closed yet, then I’ll post some updates, if that can helps anyone…!

    Thanks again for your help, in addition to being an excellent plugin, your support is really top notch. Thanks @vmarko !

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @erua97

    You are most welcome!

    We would really appreciate it if you could take a minute and post a review here. This will help us to continue offering a top-notch product to users.
    Thanks!

    Thread Starter erua97

    (@erua97)

    Of course, it is with pleasure, well deserved

    Thread Starter erua97

    (@erua97)

    Hello !

    Is there a way to prevent the flush_post_cache function for all actions that call this function? My problem is still not resolved and I have not found any solution despite a lot of research…

    Thank you so much…

    Thread Starter erua97

    (@erua97)

    I think I have identified the chain of events that is causing the problem:

    The acf-frontend-form-element-pro plugin generates the ‘acf_update_field’ action.
    In response to this action, the advanced-custom-fields plugin calls the wp_insert_post function from the acf-field-functions.php file.
    The wp_insert_post function generates the ‘save_post’ action.
    The W3 Total Cache plugin intercepts the ‘save_post’ action via the W3TC\Util_AttachToActions–on_post_change hook and triggers the ‘w3tc_flush_post’ action.

    What remains for me to do?
    Life is not easy when you are not a dev 🙁

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.