Forums

Dave's WordPress Live Search
Great But Very Slow Plugin! (6 posts)

  1. Davi de Assis
    Member
    Posted 1 year ago #

    Hi! This is an excellent plugin, maybe the best in class. But it is very slow to show all results. =/

    It would be great if there was a cache or something like that, with all permalinks and titles of published posts... or anything that makes it more dynamic. Is it possible?

    Oh... and is there any way to load the script of the plugin before all others? The plugin takes a long time to be loaded and available for use.

    Thanks!

  2. Dave Ross
    Member
    Posted 1 year ago #

    I was talking with another user about changing the Javascript file from a .js.php (dynamically generated Javascript) to a static .js file in the next release. This will certainly be served faster and allow the web server to cache it. The downside is that this static file needs to be writeable by the web server and I'm worried that's going to make the plugin "break" for a lot of people when they're tinkering with their site's files.

    I have the current version running on shared hosting and it's still plenty snappy. Try enabling/disabling other plugins to see if one is causing WordPress to take a long time to "bootstrap". Because of how Dave's WordPress Live Search pulls configuration data and search results from WordPress, it basically takes as long as any other page load to do its thing.

    Also, make sure you have a PHP accelerator (APC, eAccelerator) installed. They do wonders for WordPress performance.

    I might start caching results for anonymous users.

  3. Dave Ross
    Member
    Posted 1 year ago #

    The static Javascript file will be part of v1.20. It's in the current dev version if you want to give it a try.

  4. Bernhard Riedl
    Member
    Posted 1 year ago #

    Hi Dave,

    Thanks again for your plugin, I just wanted to contributed two thoughts to your performance discussion:

    I'm using this technique in my plugins to hand over parameters to my JavaScript code.
    Thus, I can use static JavaScript-files which get cached and can be gzipped - maybe you want to have a look.

    Another thought that might decrease your code-base whilst enhancing the flexibility at the same time (about performance I'm not sure, but might also be better, because the WP guys have optimized it) would be to use wp_ajax-hooks instead of your own bootstrap.

    Greetz,
    Berny

  5. Dave Ross
    Member
    Posted 1 year ago #

    Hi Bernhard! Last time I looked at the wp_ajax hooks, they were poorly documented and rarely used outside WP's admin code. They're still poorly documented, but I found a brief tutorial that answered my questions and got me up & running. The current dev version works using wp_ajax now. I don't think it sped anything up, but it bought me some flexibility. I don't have to try & find the URL of my ajax script anymore.

    Thanks for the nudge!

    - Dave

  6. Bernhard Riedl
    Member
    Posted 1 year ago #

    Hi Dave,

    You're welcome. - Thanks for the implementing effort. :)

    What do you think about my other proposal (no need to generate your JavaScript-file)?

    Happy WordPress coding,
    Berny

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic