• Hi,

    Thank you for this amazing caching plugin, I’m using it more an more!

    I have to exclude many user agents (like 50) on every WordPress install where I’m using the plugin. Any chance to bulk import the user agents for the exclude function?

    I found this part in your code:

    
    if(get_option("WpFastestCacheExclude")){
    	update_option("WpFastestCacheExclude", $data);
    }else{
    	add_option("WpFastestCacheExclude", $data, null, "yes");
    }
    

    If you can show me how to build $data, I think I should be able to bulk import it.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Emre Vona

    (@emrevona)

    You should update the following file;

    1. open /wp-fastest-cache/wpFastestCache.php
    2. go to 924. line

    protected function get_excluded_useragent(){
    return “facebookexternalhit|WhatsApp|Mediatoolkitbot”;
    }

    3. Add the user-agents as useragent1|useragent2|useragent3

    Thread Starter nicoter

    (@nicoter)

    Many thanks for your reply.

    But this will get rewritten with every update of the plugin.

    Any update-proof solution?

    Thread Starter nicoter

    (@nicoter)

    1) I managed to programatically update the WpFastestCacheExclude option, but the new user agent was not written into .htaccess

    2) Another approach I tried is to add multiple user agents through the plugin settings by using this syntax:

    
    (UserAgent1|UserAgent2|UserAgent3)
    

    It gets written into .htaccess like that:

    
    RewriteCond %{HTTP_USER_AGENT} !(UserAgent1|UserAgent2|UserAgent3) [NC]
    

    but it doesn’t work, the pages are still cached when accessing it with a user agent in question.

    Any help is appreciated!

    Thread Starter nicoter

    (@nicoter)

    Can you make this function public instead of protected in a new release?

    
    protected function get_excluded_useragent(){
        return "facebookexternalhit|WhatsApp|Mediatoolkitbot";
    }
    

    This should allow me to rewrite it. Or do you have a better suggestion?

    Plugin Author Emre Vona

    (@emrevona)

    If I make public this function, does it solve your problem? did you convert it to public and try?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Bulk exclude user-agents?’ is closed to new replies.