• I have an ajax request and am trying to speed up the response time. Initially, I was using the recommended admin-ajax.php approach. However, the overhead of having to load the entire framework on every ajax call seems like too much. So, I implemented the SHORTINIT approach. However, when I try to do any query related to taxonomies, it fails (i.e., get_terms, WP_Query with a tax_query, etc.).

    I get errors for missing class files (class-wp-tax-query and class-wp-meta-query). So, I include those is my list of requires.

    However, then the queries just silently fail and do not return data.

    Is it possible to use these components of the framework without doing a full load of WP?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The short answer is no.

    If you are running into performance issues, some sort of caching scheme might help, but if each query is unique, caching will not help. It may be the bottleneck isn’t so much WP as your hosting setup. If that’s the case, you should discuss the problem with your host’s customer support. You need to identify precisely where the problem lies in order to fix it.

    Another possible solution is to bypass WP entirely and directly connect and query the WP database using only basic PHP mysqli functions.

Viewing 1 replies (of 1 total)
  • The topic ‘SHORTINIT and taxonomy queries’ is closed to new replies.