WordPress.org

Forums

W3 Total Cache
W3 Total Cache Minify - JS and CSS Files Not Created (nginx) (3 posts)

  1. microberto
    Member
    Posted 2 years ago #

    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:
    http://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://wordpress.org/plugins/w3-total-cache/

  2. Shankhajit
    Member
    Posted 2 years ago #

    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.

  3. Shankhajit
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic