Open s60v5 opened 3 weeks ago
I have noticed this issue, too. A client of mine uses Cloudways to host many of their websites and they have Varnish enabled. If I purge Varnish and then "Regenerate Files & Data" in Elementor, the CSS also returns 404. If I refresh the admin panel, the CSS seems to be regenerated at this point and the site loads as expected on the frontend without missing CSS.
We are also seeing the same issue as Roy on a few sites. WP Engine sites seem to be fine, only Cloudways (and we use CloudFlare).
Hi @s60v5.
We appreciate your involvement in our community. For efficient troubleshooting, please remember to include the
FULL, and essential System Info with each issue reported. We'll need it to help you effectively.
Prerequisites
Description
Hi Elementor Team! First of all, thanks for all your work on the Elementor plugin.
We noticed an issue with the Elementor regenerate CSS functionality. Even though it's called "Regenerate CSS" it doesn't actually regenerate CSS, but just removes the content of the
wp-content/uploads/elementor/css
directory and the actual regeneration happens on the next visit. If this is designed like this purposely, it should be renamed to something like "Purge CSS", otherwise I noticed that a lot of people including me use this hoping that it will preregenerate css for their site.I have noticed that many people on the Elementor GitHub repository and WordPress forum who have this problem, use some kind of caching like Varnish, a plugin, or a CDN html caching (Azure, Cloudflare, Kinsta etc), so my guess is that there is some conflict and the actual CSS generation never happens because request never hits the server.
I think this function needs to be renamed to "Purge" or the Elementor team should consider adding an actual "Warm Up/Generate CSS" option. I believe this would make life easier for many people, as we currently have constant problems with missing CSS on our sites. To address this issue I temporarily wrote my custom plugin to purge Elementor CSS using Elementor API, and then regenerate CSS for every post that is created with Elementor, this includes posts, pages, header, footer etc.
For a medium-sized site, this code takes around 1-2 seconds to finish, but of course, there might be performance concerns with bigger sites, so perhaps there is a better way to implement this.
The main point of this whole thing is to allow people to use caching mechanisms like Varnish or CDN, and the external file print method, because this provides better performance, and at the same time ensure that we NEVER see 404 CSS errors. I saw that in previous GitHub issues, someone from Elementor suggested switching to the CSS embed method, but for us, this is not good as we are always aiming for the best speed and optimization.
Thanks!
Steps to reproduce
Expected behavior
Isolating the problem
Elementor System Info
Agreement