Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1316033

    Hi Guys,

    Current Version 4.8.6

    Enfold generates a second CSS file called Post CSS, one for evey page on the site.
    What is the purpose of this. It almost looks like critical CSS? But not sure that it covers everything required to remove the renderblocking warning in Light House.
    Can you provide an explanation?

    Caching issue
    I have found that the Post CSS file is not updating when I make changes to any of my sites. The browser is caching the file and because the name is not dynamically generated it remains in the cache after the site has been altered.

    This is unlike the merged CSS, JS and Dynamic Avia which are given unique strings/filenames to prevent caching issues.

    Is there a way to add this feature to the Post CSS generator or do you have another possible solution to prevent caching problems with the Post CSS Generator? This has caused a lot of issues when working on development sites and even worse problems on live sites where visitors browsers still hold the older version of the Post CSS files. Making the site look broken.

    #1316048

    Hey Thomas,

    Thanks for contacting us.

    The post css files hold custom stylings for ALB elements that had been placed inline html style=”..” before.
    We started to change this with 4.8.4 for 2 main reasons:

    – make the code for the elements better maintainable and readable (and keep it stable) because creating the stylings and layout html has been seperated
    – we started to add more styling possibilities to elements like button, notification box, section, columns, … (and will continue with it in oncoming versions) and inline styles do not support everything (e.g hover effects, …)

    If you check the HTML of a page you will find the link to the css file:

    
    <link rel='stylesheet' id='avia-single-post-206-css'  href='http://localhost/wp56/wp-content/uploads/avia_posts_css/post-206.css?ver=ver-1628531209' type='text/css' media='all' />
    

    The “ver=…..” is a unique timestamp that is generated when the css file is generated (once on first page load or when it had been invalidated).

    The css file(s) are invalidated:
    – when a page/post/… is updated
    – when saving theme options
    – when theme is updated (action ava_after_theme_update is triggered)

    With 4.8.6.1 we added filter avf_post_css_create_file to skip generating these files and add it in

    <style>..</style>

    tags:

    see https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/Performance/avf_post_css_create_file.php

    So on developing sites you can use the filter, on live sites after changing files save theme options and clear server cache should do.

    Best regards,
    Günter

    #1316059

    Thanks Gunter.

    Really useful I get it now. Thankyou.

    I think I have found the cause of the problem.
    In the performance panel I had remove query strings turned on. This breaks the version numbering for the post-xxx.css file – But does not appear to break other files (probably because dynamic avia gets its own unique name when generated rather than just version numbers).

    I am making sure I leave query strings enabled from now on accross all sites.

    Hope this helps anyone else experiencing caching issues with Post CSS :)

    #1316062

    Hi,

    Thank you for this feedback and sharing this information.

    Glad that everything is working now.

    Best regards,
    Günter

    #1324254

    Thanks to ThinkJarvis for the tip and to Günther for the explanation. I lost quite some time trying to figure out why there were random additional http requests in combination with W3 Total Cache, causing various issues. Additional persistent files in /uploads/avia_posts_css/ and /uploads/dynamic_avia/ did not go down well with the cache plugin. :-)
    Changing the setting to “leave query strings enabled” in Enfold Performance solved these issues.

    Enfold Team, wouldn’t it be a good idea to make a sticky post about this? While it’s great that code gets enhanced and refactored, in this case it could cause troubles for those who upgraded from older Enfold versions, had that setting to remove the query strings and use a caching plugin, like probably many people do. It would also be nice to be warned beforehand, if possibile.
    Or, if the version strings are that indispensable because of the new coding way, why not remove the option “remove query strings” from the performance settings? But correct me if I did not understand the issue enough.

    BTW, thanks for all the good work and support, much appreciated.

    Best regards,
    Rob

    #1324405

    Hi,


    @rob2701

    Sorry for the problems you had.

    You are absolutly right, that the option “Remove query string from static resources” does not make sense for our post css files.
    Somehow I simply missed, that this option was part of Enfold.

    I’ve added to core for next release that this option now will be ignored for our post css files but not for the other files.

    Best regards,
    Günter

    #1324406

    Hi Günter,

    Thanks for the update. I also would like to request that you look carefully at the selected location for the files, regarding its impact on caching plugins effectiveness (and maybe also its effect on translation plugins). For myself I will use the filter avf_post_css_create_file to skip generating these files, as you mentioned in another post.

    Keep up the good work and have a nice day!
    Rob

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