• Resolved fkoomek

    (@fkoomek)


    Hello.
    I am using W3 total cache and have a problem when Autoptimize cache is cleared and W3 total cache not. There are missing CSS files then.
    I went through the forum and found a hook that seems to work
    – autoptimize_action_cachepurged.
    However, I would like to ask.
    Is it possible to disable automatic purging AO cache? Or what is the rule for purging AO cache automatically?
    I would like to purge AO only when the W3 total cache is purged which is once a day.
    Thanks

    • This topic was modified 4 years, 9 months ago by fkoomek.
    • This topic was modified 4 years, 9 months ago by fkoomek.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    there is no automatic cache purge in AO fkoomek, AO tries to integrate with W3TC to clear the page cache as well when you manually purge AO’s cache, but that seems to have not worked? anyway, give the “404 fallback” option a try, that should prevent things from breaking down badly.

    hope this helps,
    frank

    Thread Starter fkoomek

    (@fkoomek)

    Ok.
    Many thanks.

    Thread Starter fkoomek

    (@fkoomek)

    Is there a hook for clearing AO cache?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    sure, you can use autoptimizeCache::clearall() ??

    Thread Starter fkoomek

    (@fkoomek)

    Thank you ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome, feel free to leave a review of the plugin and support here! ??

    have a nice weekend!
    frank

    Thread Starter fkoomek

    (@fkoomek)

    So did you say that when W3 total cache is cleared AO cache should be cleared as well?
    How to disable this integration?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    with this code snippet;

    
    add_filter( 'autoptimize_filter_main_hookpagecachepurge', '__return_false' );
    Thread Starter fkoomek

    (@fkoomek)

    And the code goes to the functions.php?
    Unfortunately, it doesn’t work.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    functions.php or using e.g. code snippets.

    it’s entirely possible W3TC itself also somehow deletes AO’cache, that I do not have control over.

    Thread Starter fkoomek

    (@fkoomek)

    When I insert it to functions.php it doesn’t work.
    But I believe the interaction is done by your code because I tried to delete this whole piece of code from autoptimizeMain.php:

            // hook into a collection of page cache purge actions if filter allows.
            if ( apply_filters( 'autoptimize_filter_main_hookpagecachepurge', true ) ) {
                $page_cache_purge_actions = array(
                    'after_rocket_clean_domain', // exists.
                    'hyper_cache_purged', // Stefano confirmed this will be added.
                    'w3tc_flush_posts', // exits.
                    'w3tc_flush_all', // exists.
                    'ce_action_cache_cleared', // Sven confirmed this will be added.
                    'aoce_action_cache_cleared', // Some other cache enabler.
                    'comet_cache_wipe_cache', // still to be confirmed by Raam.
                    'wp_cache_cleared', // cfr. https://github.com/Automattic/wp-super-cache/pull/537.
                    'wpfc_delete_cache', // Emre confirmed this will be added this.
                    'swift_performance_after_clear_all_cache', // swift perf. yeah!
                    'wpo_cache_flush', // wp-optimize.
                    'rt_nginx_helper_after_fastcgi_purge_all', // nginx helper.
                );
                $page_cache_purge_actions = apply_filters( 'autoptimize_filter_main_pagecachepurgeactions', $page_cache_purge_actions );
                foreach ( $page_cache_purge_actions as $purge_action ) {
                    add_action( $purge_action, 'autoptimizeCache::clearall_actionless' );
                }
            }

    And then it worked. W3 Total Cache and AO don’t interact anymore.
    I just cannot unhook it through functions.php.

    • This reply was modified 4 years, 9 months ago by fkoomek.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    in that case there’s a problem with either the code snippet or with how it was added or the priority?

    Thread Starter fkoomek

    (@fkoomek)

    I don’t really know ?? I tried to add a higher priority.
    I tried to wrap it with the init hook with no luck. I am not developer ??

    So, for now I just commented this in the source code:

    /*add_action( AUTOPTIMIZE_SETUP_INITHOOK, array( $this, ‘hook_page_cache_purge’ ) );*/

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    that would work too, but do take into account that you’ll have to re-do that with every update (and 2.7.4 is coming somewhere next week) ??

    Thread Starter fkoomek

    (@fkoomek)

    Yes, I know. Thanks ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Refused to apply style’ is closed to new replies.