[wp-trac] [WordPress Trac] #33252: Add a Faster SHORTINIT-like admin-ajax Alternative
WordPress Trac
noreply at wordpress.org
Tue Aug 4 03:34:48 UTC 2015
#33252: Add a Faster SHORTINIT-like admin-ajax Alternative
-----------------------------------------+-----------------------------
Reporter: bfintal | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.2.3
Severity: normal | Keywords:
Focuses: ui, javascript, performance |
-----------------------------------------+-----------------------------
The existing `admin-ajax.php` is slow because it loads the whole Core.
Even though that's useful, this makes `admin-ajax.php` slow to use in
front-end scenarios where you need fast responses.
Some code snippets exist that circumvent this by creating their own ajax
handlers that utilize the SHORTINIT constant. Although these solutions
would require you to load `wp-load.php` yourself which is not advised.
E.g. https://coderwall.com/p/of7y2q/faster-ajax-for-wordpress from 2012
I'd like to propose a feature request for an `admin-ajax.php` likehandler
that:
* doesn't load the whole core,
* loads only some essential functions similar to the functionality given
by SHORTINIT
Implementation suggestion: The best way to implement this in my opinion is
to create 2 new action hooks `wp_ajax_shortinit_{action}` and
`wp_ajax_shortinit_nopriv_{action}` that behaves identically with
`wp_ajax_{action}` and `wp_ajax_nopriv_{action}` except that the
SHORTINIT-like environment is implemented.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33252>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list