• I have a WordPress site I’m trying to minify with W3 Total Cache. It runs on nginx on Ubuntu 12.04.

    • I am in manual minify mode
    • In the minify settings, I have the Rewrite URL structure option OFF. It doesn’t work either way, but this method needs less nginx config.

    When I load the site, it tells WP to load from the following path:

    /wp-content/plugins/w3-total-cache/pub/minify.php?file=5fe99/default.include-body.baf22c.js

    Likewise, had I turned Rewrite URL structure ON, that path would be: /wp-content/cache/minify/000000/5fe99/default.include-body.baf22c.js

    That file does not exist and it 404’s if you try to go to it.

    Looking at that directory, I have:

    ~/public_html/wp-content/cache/minify/000000/5fe99$ ls -lah
    drwxrwxrwx 2 www-data www-data 4.0K Jun 26 08:51 .
    drwxrwxrwx 3 www-data www-data 4.0K Jun 26 08:51 ..
    -rw-r--r-- 1 www-data www-data   13 Jun 26 08:51 default.include-body.js.id
    -rwxrwxrwx 1 www-data www-data   13 Jun 26 08:23 default.include.css.id.old

    Other potential solutions:

    • I’ve tried recursively doing a chmod 777 on the entire cache directory, but it just never creates this file, nor does it report an error.
    • I’ve successfully installed and used yui-compressor and Oracle Java, but the file still doesn’t get created with that either. So I know it’s not a JSMin problem.

    Contents of local nginx.conf file:

    When Rewrite URL structure is OFF, this is all that is requested:

    # BEGIN W3TC Minify cache
        location ~ /home/MY_HOME_DIR/public_html/wp-content/cache/minify.*\.js$ {
            types {}
            default_type application/x-javascript;
            expires modified 31536000s;
            add_header Vary "Accept-Encoding";
            add_header Pragma "public";
            add_header Cache-Control "max-age=31536000, public";
        }
        location ~ /home/MY_HOME_DIR/public_html/wp-content/cache/minify.*\.css$ {
            types {}
            default_type text/css;
            expires modified 31536000s;
            add_header Vary "Accept-Encoding";
            add_header Pragma "public";
            add_header Cache-Control "max-age=31536000, public";
        }
        location ~ /home/MY_HOME_DIR/public_html/wp-content/cache/minify.*js\.gzip$ {
            gzip off;
            types {}
            default_type application/x-javascript;
            expires modified 31536000s;
            add_header Vary "Accept-Encoding";
            add_header Pragma "public";
            add_header Cache-Control "max-age=31536000, public";
            add_header Content-Encoding gzip;
        }
        location ~ /home/MY_HOME_DIR/public_html/wp-content/cache/minify.*css\.gzip$ {
            gzip off;
            types {}
            default_type text/css;
            expires modified 31536000s;
            add_header Vary "Accept-Encoding";
            add_header Pragma "public";
            add_header Cache-Control "max-age=31536000, public";
            add_header Content-Encoding gzip;
        }
        # END W3TC Minify cache
    <code></code>

    Another error:

    Meanwhile, I also get this error:

    Recently an error occurred while creating the CSS / JS minify cache: A group configuration for "include-body" was not set.

    The plugin author has reported this as a frequent false positive, but that was two years ago. I’m not sure what that means, there’s not much good information on it.

    Since we hardly get answers here, maybe someone will want some StackOverflow points:
    https://stackoverflow.com/questions/24433079/wordpress-w3-total-cache-minify-js-and-css-files-not-created-nginx

    So… has anyone ever gotten file minification to work with W3 Total Cache on nginx? Thanks!

    https://www.ads-software.com/plugins/w3-total-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am in manual minify mode, with css and js minify
    In the minify settings, I have the Rewrite URL structure option OFF.
    While the Rewrite URL structure option ON, it perfectly generate js and css files in wp-content/cache/minify/000000/672c9/ directory, but while it is OFF, the files are not generated.

    • I am working on localhost with virtual host.
    • The w3 total cache version is: 0.9.4
    • wordpress version is: 3.9.2

    Please help me.
    Regards,
    Shankhajit
    Developer
    Pkweb Solutions.

    Is there no solution on My issue? Please help me. I want to generate css and js file in “/wp-content/cache/minify/000000/60eac/” directory with Enabling “Rewrite URL structure”.
    I am Using,

    • Localhost With Virtual Host
    • WordPress Version: 3.9.2
    • w3 Total Cache Plugin Version: 0.9.4

    Regards,
    Shankhajit.
    Developer,
    Pkweb Solutions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘W3 Total Cache Minify – JS and CSS Files Not Created (nginx)’ is closed to new replies.