• Resolved hakuni

    (@hakuni)


    Hello!

    W3 total cache doesn’t minify anything when minify mode is on auto. When I have it on manual, it works when I have version numbers in queries (like some-file.js?ver=1.2.3).

    But when I remove the string queries, both the combined/minified AND the original files are loaded. Which is obviously not what I want. See https://imgur.com/a/eWVMmpA.

    I also tried having wrong version number in a query, and it didn’t work. Which means that the first way is not an alternative, I don’t want to change the queries every time something is updated.

    Almost all my javascript and css files are already minified. But I’d want to combine them and load them with async. Preferably in auto-mode, but as long as it works it’s okay.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @hakuni

    Thank you for reaching out and I am happy to assist you with this.
    Well, we have a first time for everything ??
    Can you please make sure that once Auto Minify is enabled in the General settings, the JS minify and CSS minify are enabled also in Performance>Minify?
    Can you please share the screenshot of the settings?
    I can also see that you are using a plugin for translation and this may be a problem since the files in the other language may not be minified.
    Can you please confirm this?
    Thanks!

    Thread Starter hakuni

    (@hakuni)

    Hello Marko, and thank you for helping me!

    Oh, first time? That’s never a good thing ??

    Here are a bunch of screenshots from the settings. Now that mode is on auto, nothing happens. It’s like minify was turned off.
    https://imgur.com/a/xcw2eqG

    Correct, I’m using Translatepress. But currently I’m using the original language, nothing should be translated. I’m prepared that it might be a problem with caching, but so far it seems to work. The translated text is (as far as I’ve understood) only changing the main html-document, so no javascript and definitely no css should be involved. Also, that shouldn’t affect minification? Since those links are direct links to the files, not “wordpress URL:s”. That means the language tags (example.com/language-tag/some-page) shouldn’t affect minification, as far as I’ve understood it?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @hakuni

    Thank you for your reply.
    I can confirm that I can see the files are not minified and that Minify is enabled.
    It seems like the minify rewrite rules are not applied. Can you please check the /wp-content/cache/minify/.htaccess if it exists and compares the rules in that file with the ones in Performance>Install (Under the W3TC settings).
    I can see that both languages are in use. We do have an extension for WPML(Pro version) which helps with the caching performance of websites localized by WPML. This is related to the language tag and the localization of JS/CSS files.
    It would be great if you could disable the translate plugin and see if minify works.

    Thanks!

    Thread Starter hakuni

    (@hakuni)

    Hello again Marko!

    Those files match, they both look like this:

    # BEGIN W3TC Minify cache
    FileETag MTime Size
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header set Cache-Control "max-age=31536000, public"
    </IfModule>
    # END W3TC Minify cache
    # BEGIN W3TC Minify core
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /wp-content/cache/minify/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.+\.(css|js))$ /index.php [L]
    </IfModule>
    # END W3TC Minify core

    I’ve inactivated Translatepress, and now it works. Kinda. There are fewer Javascript and css files than before, but definitely more than one of each. And I’m wondering about where the problem is? I’d really prefer to continue using Translatepress, it seems to be the best multilingual plugin for us. And I’d also like to continue usin W3TC. Both plugins are great and used by a lot of people, so it would be nice if they worked together.

    I’ll probably end up using Async Javascript and Autoptimize in combination with W3TC and Translatepress. But it means 2 more plugins, and even more possibilities for errors.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @hakuni

    Thank you for your reply.
    There is a possible solution for this, however, this is only available in the Pro version of the website and some custom code editing. Since this is related to the Pro version I would advise reaching out to us directly via the plugin in Performance>Support if you are interested in this.

    Thanks!

    Thread Starter hakuni

    (@hakuni)

    Hello Marko!

    Thank you for your help. For now I’ll manage with the free version. But at least now you know about this error, maybe this can be fixed in the future, for the next person in my situation? Or in case it’s a big thing, an extra plugin like you’ve done for WPML. I’ll also tell the Translatepress team about this, I don’t know which plugins “fault” this is.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘After minification, the original files are loading too’ is closed to new replies.