Ajax takes 10x as long as it should/could

Posted by Prem Tiwari | Updated on

Yep, this is nasty issue that to have full WordPress environment you need to spend considerable time loading it.

I’ve needed much better performance (for very dynamic incremental search feature) for work and what I went with is:

  1. Custom file as Ajax handler.
  2. SHORTINIT constant for limited WP core load.
  3. Very selectively loaded parts of core, only those needed for the task.

This provides very limited environment, but performance is way way better and reasonable degree of compatibility with WP (starting with $wpdb) is retained.

Here is start my loader file, not pretty but works for specific needs:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers