-
AuthorPosts
-
August 30, 2022 at 2:40 pm #1363207
Hi there,
We’ve been struggling for a while with page edits not showing up on our page properly, e.g., font color changes not being displayed and background color settings in the color section not reflecting live.
After doing some digging, it seems like the Avia page builder creates the background by storing a separate CSS file (one for each post) which we believe is what creates these issues. These CSS files are being sent out with a max-age of about 6 days, so they are getting cached by servers, browsers, Cloudflare, etc.
It is standard for CSS pages to get cached because they do not change with dynamic content. Where they do change, other developers implement hashes or timestamps, either in the filename, or the query string, e.g. page.css?timestamp=1234. That would tell everyone the page has changed.
See, for example, our hosting provider recommends adding query parameters to CSS files which change regularly. In the absence of this, they will appear stale because of default caching headers.
Is this something you would be able to implement in the next update?
Thanks,
RobertaAugust 30, 2022 at 3:20 pm #1363214What version of Enfold are you using?
As far as I am aware this issue was addressed a few versions ago. Originally the Post-xxx.css files did not have a version query at the end. They do in the current version of Enfold.If you have remove query strings turned on then the cache wont ever update. The team at Enfold made it so that the built in remove queries excludes the post css folder. But other plugins or even server side caches may be set to remove query strings.
- This reply was modified 2 years, 2 months ago by thinkjarvis.
August 30, 2022 at 6:58 pm #1363286Hi Roberta,
The default behaviour is add a version number to the end of the CSS file. I’m not sure exactly what the problem is on your site, but your can check the different settings under Enfold->Performance->Show Advanced Options.
If you would like to try and turn off the post CSS creation, then please try this in functions.php:
/** * 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,
Rikard- This reply was modified 2 years, 2 months ago by Rikard.
August 31, 2022 at 11:38 am #1363338Thank you so much for your prompt and helpful responses. We discovered that our Unique timestamp setting (under Enfold->Performance->Show Advanced Options) was not set to default, which is what prevented the timestamps from being included as a query string. Thanks also for the tip on disabling post CSS files; that can be very useful in some cases!
August 31, 2022 at 12:11 pm #1363344I thought that might be the case. Glad it worked for you.
I have used Rikards solution on a few sites before.
Actually loading the CSS inline rather than post css can be faster on first pageload but second pageload will be quicker with the post css file.So the Post CSS is the right route if you can keep it activated.
if you use any kind of caching you need the timestamps turned on (the default setting) and leave query strings turned on.
September 2, 2022 at 3:05 pm #1363662Hey,
We are glad that Rikard could help!
@thomasjarvisdesign Thanks for your input :)Regards,
Yigit -
AuthorPosts
- You must be logged in to reply to this topic.