Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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.

    css caching

    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,
    Roberta

    • This topic was modified 2 years, 2 months ago by Roberta.
    • This topic was modified 2 years, 2 months ago by Roberta.
    #1363214

    What 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.
    #1363286

    Hi 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.
    #1363338

    Thank 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!

    #1363344

    I 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.

    #1363662

    Hey,

    We are glad that Rikard could help!


    @thomasjarvisdesign
    Thanks for your input :)

    Regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.