Ajax Search Pro Invalidating Varnish Cache on Pantheon platform

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Ajax Search Pro Invalidating Varnish Cache on Pantheon platform

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 8 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8786
    andrewhuntero3
    andrewhuntero3
    Participant

    Hello,
    We are currently having an issue with a site we recently launched (www.preit.com) where we are seeing in our general monitoring that varnish cacheing is not working. We have pin pointed the issue to the ajax search pro plugin, as when we turn it off we can confirm that varnish cacheing is working (this can be seen here: http://varnishcheck.getpantheon.com/varnish/dev-preit.pantheonsite.io). I believe the issue may be stemming from the fact that the Pantheon platform requires all user sessions to be offloaded to the database via their php sessions plugin (https://wordpress.org/plugins/wp-native-php-sessions/). This issue is causing very high load times for users so we would like to resolve it as quickly as possible, thank you

    #8787
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I think I might know what is causing the problem. In the recent version I integrated a session handler class, which appears to be loading the sessions even when not in use in some cases. I’m working on an update resolving this problem permanently.

    If you want, you can try the following temporary solution, although the search override functionality will be disabled as a result.

    1. Open up the wp-content\plugins\ajax-search-pro\includes\classes\filters\class-asp-searchoverride.php file and scroll to line 21, which should be empty. Put this statement there:

    return $posts;

    2. Now open the wp-content\plugins\ajax-search-pro\includes\classes\core\class-asp-manager.php file and scroll to lines 91-92, where you should see this:

                require_once(ASP_CLASSES_PATH . "session/wp-session.inc.php");
                wd_asp()->wp_session = WP_Session::get_instance();

    Remove or comment these lines out, so the session handler is not included.

    I suspect that this will solve the issue immediately. I have yet to test a different solution on a test environment with varnish cache enabled. Let me know if this changes anything.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #8790
    andrewhuntero3
    andrewhuntero3
    Participant

    Ernest,
    Thank you for your quick response with such specific code fixes. Im happy to report that your suggested changes indeed fixed the varnish issue right away (you can see it in action on a dev environment here: http://varnishcheck.getpantheon.com/varnish/develop-preit.pantheonsite.io). Since we manually altered the plugin files we will be holding off on updating until this fix is included in an update. Thank you again

    #8791
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Great! You are welcome, I’m glad it helped 🙂

    Thank you very much for the feedback, now I know exactly what is causing the issue. This I’m definitely fixing in the upcoming version. If you get a notification that plugin version 4.9 is available, you can safely update. (within a couple of days hopefully) The fix will be indicated in the update notes as well.

    If you don’t mind I’m closing this topic for now and marking it as resolved, in case of issues feel free to open another one.

    Also, if you like the plugin, feel free to rate it on your codecanyon downloads page, it’s greatly appreciated.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Ajax Search Pro Invalidating Varnish Cache on Pantheon platform’ is closed to new replies.