admin-ajax.php
-
I really like this plugin, but calling admin-ajax.php is causing posts and pages to take an extra 0.5s to load. Might it be possible to use an alternative, lighter method?
-
Hmm, interestingly, although I’m using a caching plugin, for which you recommend the javascript method of recording post views, it looks as though the PHP method works fine when using Comet Cache.
Good to know about Comet Cache.
When it comes to admin-ajax.php, it should not slow down ajax requests – PVC does nothing in the admin (except dashboard widget), and is used to fire a simple function. Maybe there’s another factor in this.
Regards,
Bartosz / dfactory teamUnfortunately, there’s no other factor involved in the
admin-ajax.phpissue. I have spent quite some time diagnosing this, and have turned off other plugins to make sure. The most helpful resource I found is here: https://www.keycdn.com/blog/admin-ajax-php-slow/When the plugin is active,
admin-ajax.phpis called, and that adds another 0.5 seconds to the page loading time. When the page otherwise loads in around 1 second, that means an additional 50%.Obviously, if the PHP method continues to work with Comet Cache, then I’ll stick with that. But you might want to take a look at the above article just the same.
If you can enable the JS mode we’d like to take a look.
OK! JS mode is now enabled, and the site is https://webby-books.com/ I have been using GTMetrix to see what’s going on: https://gtmetrix.com/
Looks like in most cases you have only one admin-ajax.php request per page.
So I believe the influence on loading time is related to the fact that admin-ajax.php is called at all, not that PVC is doing that.
If there was a different plugint doing Ajax on page load, you would have the same result probably.
The time required to run admin-ajax.php depends on number of things like your server enviroment, number and quality of plugins used, current theme, etc.
I may tell you we have a plan to provide “slim” ajax mode for PVC, not relying on admin-ajax, that will load only minimal resources (and make the request much faster). However this would be an experimental ferature – according to any WP guidlines Ajax calls should run just as it is now in PVC.
Looks like in most cases you have only one admin-ajax.php request per page.
Yes, that’s right.
So I believe the influence on loading time is related to the fact that admin-ajax.php is called at all, not that PVC is doing that.
But PVC is what is calling admin-ajax.php
You can tell that from following the article to which I referred above (https://www.keycdn.com/blog/admin-ajax-php-slow/).
I can also tell that is true because if I turn off PVC, admin-ajax.php is never called.
I may tell you we have a plan to provide “slim” ajax mode for PVC, not relying on admin-ajax, that will load only minimal resources (and make the request much faster).
I am certainly interested in trying that out.
The speed of admin-ajax.php doesn’t depend on our plugin but on your WordPress install.
The article is great as it may help you optimize your site, but it’s unrelated to PVC.
Just fun fact about admin-ajax speed – if you enable WooCommerce for example, the speed might jump from 500ms to 2 seconds or so : )
Yes, I understand that: that’s the problem with admin-ajax.php: it calls stuff from the whole site. That’s why I don’t want admin-ajax.php to run at all.
Since PVC is the only thing calling admin-ajax.php, the purpose of opening this thread was to see if you can find a way to have PVC work without calling it. Your proposed “slim” ajax mode sounds like what I was hoping for.
We don’t always like admin-ajax.php too (however it has some imporant advantages).
We’ll work on a slim version, we’ll se how it works.
Thank you!
The topic ‘admin-ajax.php’ is closed to new replies.