• Resolved nulumia

    (@nulumia)


    Hello, first this has by go-to forum on all my sites now after leaving BBPress, excellent plugin!

    I’ve noticed that when using a custom asgaros-theme, the included files such as style.css and widgets.css are producing a “?ver=___” at the end, which I noticed is actually hardcoded into the plugin at /forum-thememanager.php when producing the <link entries.

    The problem is this causes caching issues and shows up on PageSpeed tests like GTMetrix.com and YSlow.

    It’s actually managing to evade my Remove Query Strings function in functions.php:

    /* Remove Query String from Static Resources */
    function remove_cssjs_ver( $src ) {
     if( strpos( $src, '?ver=' ) )
     $src = remove_query_arg( 'ver', $src );
     return $src;
    }
    add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
    add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

    It also is evading W3 Total Cache’s similar removal. Can there be a way to make this optional? Right now I have manually removed these entries but it will require doing so with each plugin update.

    Thanks for any input,

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Asgaros

    (@asgaros)

    Hello @nulumia

    The reason for adding this number at the end of the files was: Some users had problems when updating the plugin because an old version of the CSS/JS files were delivered to the users so that some design-changes were not applied correctly.

    What I can do is:

    – Remove the version-number when using a custom theme. But maybe users update their custom themes as well after an update to reflect the latest changes.
    – Add a filter for this so people can control this manually via their functions.php file.

    Basically I would prefer the last method. What do you think?

    Thread Starter nulumia

    (@nulumia)

    Thanks for the quick reply and suggestions @asgaros. I agree that your second approach may be better, this seems to be a fast growing plugin and receives regular updates, so users would want to have their changes refreshed automatically each time.

    Using an optional filter would be a great non-intrusive way of allowing more hands-on developers to have this functionality ??

    Plugin Author Asgaros

    (@asgaros)

    Hello again, @nulumia

    Just curious (because I am not an expert in topics related to caching): What exactly is the benefit of removing the version variable at the end of URLs? At first short glance when doing the page-speed tests I could not find something related to it.

    So basically we have two scenarios:

    Scenario 1: As far as I understand it should have no impact on caching as long as you dont update the plugin because the version variable never changes in this case.

    Scenario 2: The files get delivered again to the clients only when the version-variable changes. This only happens after an plugin update. And after an update we have to ensure that everyone gets the new version of the styles and scripts because some functionalities may not working anymore if they are using an old version of those files. This was the reason why I added this variable to ensure this.

    So just for a better understanding: Do you have some further information about why exactly the version variable is bad in Scenario 1 and at which point it have some impact on caching?

    • This reply was modified 8 years, 1 month ago by Asgaros.

    Currently not working and minimize CSS.
    combine versions do not allow

    • This reply was modified 8 years, 1 month ago by Yworld.
    Plugin Author Asgaros

    (@asgaros)

    Hello @yworld,

    can you be a little bit more specific because I didnt understand it. ??

    At the moment I dont see any advantage in removing that version-string (only disadvantages to be honest) and I have to decide soon whether this will be included in the upcoming v1.4 release or not.

    • This reply was modified 8 years, 1 month ago by Asgaros.

    Hello @asgaros

    Everything is fine, the problem I had
    Add 1.4 is a great idea

    Resolved ??

    Thread Starter nulumia

    (@nulumia)

    Hi Asgaros, my apologies on delay for your question, you raised good points above.

    I’ll be honest here in that I think the ability to remove version numbers may not be a big deal for most users, and I do believe it’s a feature that would only be taken advantage of more by “power users” or more hands on webmasters, that try to gain every ounce of optimization. A brief overview on this process can be seen here:
    https://developers.google.com/speed/docs/insights/LeverageBrowserCaching#LeverageProxyCaching

    When running a large site with a caching system (W3TC or WP Super Cache), it’s often ideal to remove strings so assets can be compiled into cache modules without the chance to throw errors due to changing file versions – some of these caching environments are sensitive.

    However I am currently the only one raising the issue for this plugin, and I am currently manually queuing them without strings. So I will leave this to your discretion as I can work with both results, especially this being a great free plugin.

    Regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘CSS Version numbers removable for PageSpeed/caching’ is closed to new replies.