Multiple admin-ajax.php requests from server per c…

Hello

You see, for caching at the moment I have Varnish on the server side, installed by you.

I have regularly been using AutoOptimize for scripts and styles, but I recently uninstalled it to be able to see exactly how many requests I had without it, due to server resource saturation issues.

Spinning little by little I have been removing requests, removing unnecessary plugins and right now, without using Autoptimize again, I see that the use of Contact Form 7 is generating this problem for me.

Specifically, every time I call a page where I use Contact Form 7, there is a call to admin-ajax.php.

But it happens that I have a form with a Contact Form 7 shortcode, inserted in the header of the site, which what it does is invite the visitor to put his phone number so that he puts his number. and be called by our commercial agents. and this form is displayed on all the pages of the site and, specifically, on the pages where I also have a contact form implemented for other purposes, as is the case with the “contact” page, I use a CF7 shortcode for the contact form contact and another shortcode (the one in the header), in such a way that sometimes I use CF7 x2 in some pages and at least once, in all.

When I remove the CF7 shortcode from the header, I see that admin-ajax.php is no longer called on any pages except those that do have a form.

I wonder if I can keep my CF7 shortcode in the header, so that it coexists with some other form depending on the page, and if the multiple loading of the admin-ajax.php can be technically avoided?

See also  Create Online Academy with WordPress [2022] -

Reading through the web, I have also been able to see that it is possible to deregister the crypts depending on which pages, etc, but I do not know if this is a way because I want to keep the form that I insert in all the headers, although perhaps, knowing if the script already has been called, avoid a second time and thereby avoid multiple calls to admin-ajax.php with each url, or if this is due to another conflict.

Looking forward to hear from you

Thank you

AnswerQuote

Answered: 03/09/2021 10:32 pm

Loading Facebook Comments ...
Loading Disqus Comments ...