• Recently when testing with caching plugin for performance, it is seen that analytic plugins (not google analytic) become useless as it was unable to track visitors info. Later tried with different combination of caching & analytic plugins but give the same problem, as soon as caching is enabled, analytic plugin become stop functioning…

    I have searched this topic but couldn’t get much info about the problem and how to rectify it. That’s why this thread for info

    On detail analysis about why analytic doesn’t working with caching plugin found the following –

    1. WP control structure enters very much early into the drop-in. At this stage WP system is not initialized.
    2. The cache drop-in is a dead end – i,e load the static files and exit

    Thus the WP caching plugin mechanism gives best quick performance as a static site. Since the system is not initialized, all dynamic functionality of WP are lost. As a result, Analytic plugins are unable to intercept visitors infos…

    So, how to make it possible – both caching & analytic work simultaneously. The following will provide a basic idea –

    1. For this you will need to return the WP control structure from the drop-in and carry it long enough until it loads the basic WP system with plugins.
    2. Make a custom do_action before flushing the cache
    3. Customize the analytic plugin do_action with your above custom one.

    With this you will only compensate for an average of 1 second more, but I think it will be much much beneficial. I have this result on testing – WP 3.2.1, Quick Cache and Statpress working all awesome!

    If you are plugin developer then I hope you will understand what I am saying. If a plugin author develop both the caching & analytic, then it will be easy to achieve the working of both other wise you will have to modify accordingly.

    Lastly, It will be highly beneficial if the drop-ins inclusion is further modified/optimized and provides hooks before and after it in the up coming WP version will provide great opportunities to plugins developers for lots of other use full possibilities.

    I hope this will help…
    Thanks

  • The topic ‘WP Caching plugin makes Analytics paralyzed completely’ is closed to new replies.