-
AuthorPosts
-
February 1, 2022 at 1:09 am #1338099
Hi, we just launched our website and our host (WP Engine) is reporting the following:
“your site is currently driving up server load and causing these errors. I am working to dig into why so that you can fix this quickly as it is effecting our other customers on your server. ”
“It looks like you are having heavy admin ajax hits on your site. It looks to be coming from your theme but that is as much as we are able to pin point.”
Why would the Enfold theme be causing this and how do I fix it? Or is there a way we can optimize it?
Jacob
February 1, 2022 at 9:43 am #1338174Hey Hurricane,
Thank you for the inquiry.
Do they have any info as to what kind of admin AJAX requests are occurring during heavy loads? The theme creates AJAX requests but only a few of them are scheduled and they will not be triggered without some kind of user action first, so pointing to an “admin ajax hits” is a little bit vague. It is possible that the requests are generated by a plugin.
Are you using a lot of Custom Element Templates (CET)?
Please try to disable the Enfold > Performance > File Compression settings temporarily, then add this code in the functions.php file to prevent the creation of the post css files.
/** * Filter to skip css file generation. * You can add logic to skip for certain pages/posts only. * * @since 4.8.6.1 * @param boolean $create * @return boolean true | false or anything else to skip generation of css file */ function custom_avf_post_css_create_file( $create ) { return false; } add_filter( 'avf_post_css_create_file', 'custom_avf_post_css_create_file', 10, 1 );
Best regards,
IsmaelFebruary 1, 2022 at 12:41 pm #1338206Hi!
Besides disabling css file generation, is there way to inline the css directly inside the html tag instead of creating multiple <style> tags?
Tx.
February 1, 2022 at 11:06 pm #1338322Hi Ismael,
They didn’t provide specifics, but I can ask again about it. What are Custom Element Templates so I know how best to answer your question? We are using the child theme so there are a fair amount of modifications, but fairly similar to other websites we’ve developed.
What is that code doing that you sent over? Is that going to negatively impact other areas of the website?
Thanks,
Jacob
February 2, 2022 at 4:54 am #1338350Hi,
Thanks for the update.
You can learn more about CET in this thread.
// https://kriesi.at/documentation/enfold/custom-element-templates/
The code above will just disable the dedicated css file for each post or page, which contains custom styles of the elements that are within that particular post. Disabling it will not have any negative impact to the site.
Besides disabling css file generation, is there way to inline the css directly inside the html tag instead of creating multiple
The theme generates a few inline style tags, to load fonts for example, but none of them should affect the site negatively. Majority of the css are loaded from an external file.
Best regards,
IsmaelFebruary 2, 2022 at 3:29 pm #1338482Hi,
Sorry for the misunderstanding… but what I need, for example, is to have this:
<p style=”text-align:center…>Instead of this:
<style>
.av-13b61b5cd… {text-align:center}
</style>
<p class=”av-13b61b5cd…”>Tx.
February 2, 2022 at 6:06 pm #1338520Thank you!
February 3, 2022 at 4:28 am #1338592Hi loumirak11,
That type of functionality is not available in the theme unfortunately. You might be able to find a plugin or third party code which can do that for you though.
Please open a new thread if you should have any further questions or problems @Hurricane.
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.