• Resolved Endymion00

    (@endymion00)


    Using W3TC 0.9.7.5

    When I enable minify for CSS and JS the query string is not added to the end. However if I enable HTTP/2 push, each minified file loads twice, once with the query string and once without (like it does with push is disabled).

    All the Browser Cache “Prevent caching of objects after settings change” options are enabled and the “Remove query strings from static resources” are disabled.

    Shouldn’t the query string appear on the minified files as well.

    I am running HTTP/2 so perhaps there’s an issue there since they do start appearing when the push options are enable.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Endymion00

    (@endymion00)

    It’s also looking like even thought the push loads the query string version first, when the 2nd non-query string version loads from cache, it replaces the new one and new css changes are lost. So it looks like I definitely need to get query strings on the non-pushed versions of the files. I seem to recall noticing this before so likey a bug that’s been around for a long time.

    Thread Starter Endymion00

    (@endymion00)

    One workaround appears to be disabling “Rewrite URL structure” at the top of the Minify page. While it’s unclear that it can take advantage of http/2 push in this mode (files aren’t showing twice), it does include the media string on each file.

    Still would be nicer to get the rewrite method fixed.

    Thread Starter Endymion00

    (@endymion00)

    Ok, I think I found the issue. On the Minify page, if I enable HTML & XML minify, the css & js files are not linked with their query strings. When it’s disabled, the query strings are there as expected. Also, I can leave it enabled as long as I go to General Settings and switch the HTML minifier to HTML Tidy instead of Minify.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @endymion00,

    I am sorry to hear you are having issues with Minify settings but I’m happy to assist you!
    Is HTML minify enabled in Performance>Minify? If so does the issue persist if you disable it?
    Also, try updating your.htaccess/nginx rewrite rules in Performance>Install and restart apache/nginx.

    Thread Starter Endymion00

    (@endymion00)

    HTML Minify enabled = no query strings on css and js files.
    HTML Minify disabled = expected query strings on css and js files.

    Had to switch back to disabled since switching the HTML minifier to HTML Tidy was breaking my style layout.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @endymion00,

    Thank you for the information. Can you please switch HTML minify back to Minify(default) and try adding the following:
    In wp-content/plugins/w3-total-cache/lib/Minify/Minify/HTML.php replace lines 346 and 347 with
    $m[2] = preg_replace( '/([a-z0-9]=)\'([^"\'\\s=]+[^"\'\\s=\\/])\'(\\s(?!\\/)|>)/i', '$1$2$3', $m[2] );

    $m[2] = preg_replace( '/([a-z0-9]=)"([^"\'\\s=]+[^"\'\\s=\\/])"(\\s(?!\\/)|>)/i', '$1$2$3', $m[2] );

    See if the issue persists.

    Thread Starter Endymion00

    (@endymion00)

    Unfortunately that change made no difference. Enabling HTML Minify still lost the media query strings.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @endymion00,

    Once again I am sorry about the issue you are having and thank you for your patience. This is now confirmed as a bug and we added an issue for this. We will be working on a fix for future releases.

    Thread Starter Endymion00

    (@endymion00)

    Thanks for looking into it. Hopefully the fix will present itself soon.

    I am having the same problem… all minified files are loaded twice (one with query string one without) when “Rewrite URL structure” is enabled.
    Is this bug still not fixed?

    Greetings doc

    • This reply was modified 6 years, 8 months ago by docbt.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @docbt,

    Thank you for your inquiry. I’ll check with the developers to see what is the progress with this. We are sorry but there were some more important and some security issues we needed to address to.
    Thank you for your patience.

    This still seems to happen on the latest version

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Query String not added to minified css / js’ is closed to new replies.