• 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
    system.

    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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Don’t you need reading database, access something, use Template Tags or whatever? Don’t you need to load the WP?

    Anders

    (@seananders1227)

    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.

    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:

    https://www.beautifulcoding.com/snippets/176/using-wordpress-funcitons-outside-of-wordpress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Speeding up Ajax Calls’ is closed to new replies.