I'm finalizing the page I'm working on and came to the point where some loading optimizations should be done. I found out, the pages loading times are in average between 5 and 10 seconds. When checking the request I found out the admin-ajax.php (/wp-admin/admin-ajax.php?action=dynamic_css&ver=4.9.8) alone takes about 50% of all loading time, and there are 2 identical requests. Please check attached screenshots for a refference. The response of those requests is a css, probably generated by the theme (according to css classes names)
I checked your demo site (cesis.co) and there are no admin-ajax.php requests there. How can I disable them thus speed the site by 50% and what is causing them?
If you have finished the site and will not edit the theme options then what you can do is copy all the css of this file in your child theme style.css and then disable the ajax loading of this file.
If you disable the ajax loading of the theme options css file even if you change the color settings / font settings etc it won't change on your site.
We also recommend autoptimize to optimize the loading speed.
Do not hesitate to contact us if you have more questions.
This is one way although not very user friendly. Isn't there a way to cache the theme css request? It is a huge overload to request for the same file over and over again if we exactly know when the content changed (on cesis settings save). If there is no autmoation possible a simple button in the admin besides the current "Save" would do the trick just as well.
I believe intalling some plugins woudl speed the page up but if admin-ajax.php request takes 3-4 seconds that is something no plugin can fix. Please fix that issue since a template that loads 5-10 seconds is completely unacceptable. If anything else such loading times causes many visitors to leave the page.
I really like the Cesis theme but if this issue is not going to be fixed I'm affraid I can't afford to use it in the future projects. I bought 3 licenses in the past 3 months and was planning to continue using the template on new sites but not with the current loading time.
I also tested some other templates I'm using and none of them uses the admin-ajax.php in the frontend for css.
I hope you can fix the problem and we can all use an otherwise very beautiful theme in the future!
You have only 2 option if you want to have dynamically generated css, have it put directly in the page as a big style block or using dynamic loading with ajax.
Also the 3-4 ajax loading is not normal, so this can be boosted with plugins.
Our team is working to make an option to let the user switch to static css file when they have finished to edit colors settings, which will make the theme to load an additional css file that contains the css file that is generated in the dynamic.css file.
Currently we don't have this option so we can help you set it if needed.
For generating static file I presume I only need to open the request, save the response to a css file and include it (e.g. enqueue in the functions.php). Is that correct?
When done, how do I disable loading theme css via the admin-ajax.php?
Thank you, Grega
p.s. an option to switch to static file would be great. When do you expect to have it implemented?
Regarding this "If you have finished the site and will not edit the theme options then what you can do is copy all the css of this file in your child theme style.css and then disable the ajax loading of this file."
Check the source code of your page and search for dynamic.css
Open the file and copy all the content in the child theme style.css file and then add the function we posted in our previous reply in the functions.php file of the child theme
Do not hesitate to contact us if you have more questions.
Hi,
I'm finalizing the page I'm working on and came to the point where some loading optimizations should be done. I found out, the pages loading times are in average between 5 and 10 seconds. When checking the request I found out the admin-ajax.php (/wp-admin/admin-ajax.php?action=dynamic_css&ver=4.9.8) alone takes about 50% of all loading time, and there are 2 identical requests. Please check attached screenshots for a refference. The response of those requests is a css, probably generated by the theme (according to css classes names)
I checked your demo site (cesis.co) and there are no admin-ajax.php requests there. How can I disable them thus speed the site by 50% and what is causing them?
Thanks!
Hello Gregor,
If you have finished the site and will not edit the theme options then what you can do is copy all the css of this file in your child theme style.css and then disable the ajax loading of this file.
If you disable the ajax loading of the theme options css file even if you change the color settings / font settings etc it won't change on your site.
We also recommend autoptimize to optimize the loading speed.
Do not hesitate to contact us if you have more questions.
Have a nice day!
Regards.
---------------------
Hosting we recommend ( Free SSL and CDN included in all plan ).
Speed up your site with Autoptimize
Test your site with GTmetrix and fix the issue to make it faster
How to Update your Theme
This is one way although not very user friendly. Isn't there a way to cache the theme css request? It is a huge overload to request for the same file over and over again if we exactly know when the content changed (on cesis settings save). If there is no autmoation possible a simple button in the admin besides the current "Save" would do the trick just as well.
I believe intalling some plugins woudl speed the page up but if admin-ajax.php request takes 3-4 seconds that is something no plugin can fix. Please fix that issue since a template that loads 5-10 seconds is completely unacceptable. If anything else such loading times causes many visitors to leave the page.
I really like the Cesis theme but if this issue is not going to be fixed I'm affraid I can't afford to use it in the future projects. I bought 3 licenses in the past 3 months and was planning to continue using the template on new sites but not with the current loading time.
I also tested some other templates I'm using and none of them uses the admin-ajax.php in the frontend for css.
I hope you can fix the problem and we can all use an otherwise very beautiful theme in the future!
Best,
Hello Gregor,
You have only 2 option if you want to have dynamically generated css, have it put directly in the page as a big style block or using dynamic loading with ajax.
Also the 3-4 ajax loading is not normal, so this can be boosted with plugins.
Our team is working to make an option to let the user switch to static css file when they have finished to edit colors settings, which will make the theme to load an additional css file that contains the css file that is generated in the dynamic.css file.
Currently we don't have this option so we can help you set it if needed.
Kind regards
---------------------
Hosting we recommend ( Free SSL and CDN included in all plan ).
Speed up your site with Autoptimize
Test your site with GTmetrix and fix the issue to make it faster
How to Update your Theme
Hi,
For generating static file I presume I only need to open the request, save the response to a css file and include it (e.g. enqueue in the functions.php). Is that correct?
When done, how do I disable loading theme css via the admin-ajax.php?
Thank you,
Grega
p.s. an option to switch to static file would be great. When do you expect to have it implemented?
Hello Gregor,
Yes, this is the way to do it.
You need to de-register / de-queue the "dynamic-css" file.
We have a big update with a big new feature coming up tomorrow or after tomorrow then in the next update we will try to implement it.
Do not hesitate to contact us if you have more questions.
Have a nice day!
Regards.
---------------------
Hosting we recommend ( Free SSL and CDN included in all plan ).
Speed up your site with Autoptimize
Test your site with GTmetrix and fix the issue to make it faster
How to Update your Theme
Please let me know how do I de-register the dynamic-css file. I suppose I do it in the theme's functions file, but what line do I need to add?
Thank you,
Grega
Hello Gregor,
If you are using the child theme just add this in the functions.php
Do not hesitate to contact us if you have more questions.
Have a nice day!
Regards.
---------------------
Hosting we recommend ( Free SSL and CDN included in all plan ).
Speed up your site with Autoptimize
Test your site with GTmetrix and fix the issue to make it faster
How to Update your Theme
Regarding this "If you have finished the site and will not edit the theme options then what you can do is copy all the css of this file in your child theme style.css and then disable the ajax loading of this file."
Where do I need to copy from?
Check the source code of your page and search for dynamic.css
Open the file and copy all the content in the child theme style.css file and then add the function we posted in our previous reply in the functions.php file of the child theme
Do not hesitate to contact us if you have more questions.
Have a nice day!
Regards.
---------------------
Hosting we recommend ( Free SSL and CDN included in all plan ).
Speed up your site with Autoptimize
Test your site with GTmetrix and fix the issue to make it faster
How to Update your Theme