• Resolved pgray

    (@pgray)


    Guys,

    Thank you for an amazing plugin – works great for us. Just an FYI – the instructions to use Super Page Cache with WP Rocket resulted in CF Cache being bypassed. Specifically,
    1. Remove WP_CACHE directive
    2. Remove advanced-cache.php
    3. Add wp-rocket-no-cache.php to mu-plugins
    4. In settings disable WP Rochet Page Cache

    So, we backed out of steps 1-3 and kept step 4 i.e. disabled WP Rocket Page Caching from the settings in Super Page Cache plugin and everything worked fine for us.

    Thought this might be helpful to someone using both these plugins together.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @pgray,
    In the latest version of the plugin i.e. v4.6.1 I’ve updated the guide of using WP Rocket with this plugin. Please follow the steps mentioned here to get the best results: https://gist.github.com/isaumya/d5990b036e0ed2ac55631995f862f4b8

    Hi Saumya,

    Your plugin is fantastic.

    For WP Rocket, I saw your gist and I think there’s a little mistake :

    add_filter( 'rocket_disable_htaccess', '__return_false' );

    It should be __return_true if you want to disable rules in htaccess.

    I’m not sure it’s necessary to disable all WP Rocket Rules. If I remove ExpireDefault and ExpireByType text/html rules from WP Rockets, it seem’s OK to me. FYI I use this code below :

    function remove_htaccess_html_expire( $rules ) {
    	    
        $rules = preg_replace( '@\s*ExpiresDefault \s*"access plus \d+ (seconds|minutes|hour|week|month|year)"@', '', $rules );
    	$rules = preg_replace( '@\s*#\s*Your document html@', '', $rules );
    	$rules = preg_replace( '@\s*ExpiresByType text/html\s*"access plus \d+ (seconds|minutes|hour|week|month|year)"@', '', $rules );
    
    	return $rules;
    }
    
    add_filter('rocket_htaccess_mod_expires', __NAMESPACE__ . '\remove_htaccess_html_expire');

    Also :
    add_filter( 'do_rocket_generate_caching_files', '__return_false' );

    line 22 & line 38 are the same.

    In any case, what a great job, thanks for this great plugin!

    • This reply was modified 2 years, 6 months ago by Reuhno.
    • This reply was modified 2 years, 6 months ago by Reuhno.
    Plugin Contributor iSaumya

    (@isaumya)

    Hi @laboiteare,
    Thanks for spotting the mistake and I have fixed the issue in the gist.

    Regarding the htaccess rules that WP Rocket adds, you don’t need it as if you want cache control rule for static file you can enable the option for adding browser caching rule option inside the plugin settings under the cache tab: https://i.imgur.com/Anvnipk.jpeg

    Thanks @isaumya

    You’re right, I will do it in your way! Thanks ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Instructions on using this plugin with WP Rocket’ is closed to new replies.