Speeding up Ajax Calls (4 posts)

  1. narix
    Posted 4 years ago #

    Hi there,
    I want give my ajax calls a little more Speed.

    If i run my callbacks via addaction("wp_ajax_someslowfunction") and the ajaxurl i got a response time about 1.5 seconds on my small developing mashine.
    So i decide to call a file in my plugin directly. Thats pretty fast but I need a least the wpdb Object. And to use it i have to include the wp_config.php. But these include the wp_settings and the whole big

    Why is there no possibility to include just the config and the dbclass?

    My only idea is to put the db settings in a session. But this is not so sweet and secure.

    What u think about it?

  2. shazdeh
    Posted 4 years ago #

    Don't you need reading database, access something, use Template Tags or whatever? Don't you need to load the WP?

  3. Anders
    Posted 4 years ago #

    You do need to load WP, and in my experience at the level admin ajax is executed there isn't much of a load on the WP system.

    I think the only way to make it faster would be to use some sort of caching. Obviously I have no idea of what sort of function you're doing, but if you're querying data you could load all the needed data into a JS var/array and then simply run "queries" against the array.

  4. jamielob
    Posted 3 years ago #

    Old post but in case anyone else is looking for the answer for how to load just the database functions (wpdb) of WordPress take a look at the bottom of my post here:


Topic Closed

This topic has been closed to new replies.

About this Topic