• I am writing a plugin where I want to read user agent and send custom headers back on certain agents. Unfortunately however several people have the W3 Total Cache plugin and what it’s doing is that, when I have a condition that sends back the custom header, it then sends back that custom header for ALL user agents, not running my event logic. I tried to load my event with…

    add_action('plugins_loaded','MY_PLUGIN::checkRules',-1400000000);

    …but W3 Total Cache intercepts via .htaccess or by some other mechanism. Unfortunately I have to do it at the plugins_loaded level because I need to query get_option.

    How can I make my plugin work even if W3 Total Cache is engaged?

    http://wordpress.org/extend/plugins/w3-total-cache/

Viewing 1 replies (of 1 total)
  • I’m not an expert, but I don’t think people using W3TC really want to have the functionality you mention. The whole point of a cache is to prevent PHP from being used in most page loads. If your plugin worked for every page load, having a cache would be pointless.

    Putting that aside, if people would like to cache (even an inefficient cache) and use your plugin, W3TC does support cache fragmenting. If you could somehow use cache fragmenting to prevent your plugin from being added to the cache, that could work. But if it does, let people know up front that their caches will be interrupted.

    Beyond that, there might be an option to cache seperate files for each user agent. I’m not sure my self as I haven’t had the need for it. Doing this also has drawbacks as well. The cache size will be a lot larger due to all the additional files required for duplicating pages for each user agent. This should also be mentioned up front if this is the direction you move in.

    Other than that, you could just get people to disable page caching. They could still benefit from css/javascript minification and concatenation, object and database caching, and CDN’s. Although your plugin would really need to offer something great to give up page caching.

Viewing 1 replies (of 1 total)
  • The topic ‘Intercepting Events Before W3 Total Cache Engages’ is closed to new replies.