WordPress W3 Total Cache Minify - JS and CSS files not created (nginx)

I have a WordPress site that I am trying to minimize using W3 Total Cache. It works on nginx on Ubuntu 12.04.

  • I'm in minify mode
  • In the minify settings, I have the Rewrite URL structureOFF option . This does not work anyway, but less nginx configuration is required for this method.

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

Similarly, if I turned Rewrite URL structureON, this path would be as follows: /wp-content/cache/minify/000000/5fe99/default.include-body.baf22c.js

This file does not exist and it will try to go to it.

Looking at this directory, I:

~/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 tried recursively doing chmod 777in the entire cache directory, but it just never creates this file and does not report an error.
  • yui-compressor Oracle Java, - . , JSMin.

nginx.conf:

Rewrite URL structure , :

# 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

:

, :

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

, . , , .

... - - W3 Total Cache nginx? !

+4
1

, , :

1) nginx.conf .

, , ,

http://www.domain.tld/wp-admin/admin.php?page=w3tc_install

nginx nginx.conf

2) Nginx Nginx:

nginx -s reload

service nginx restart

3) " URL" W3TC Minify.

, , , .

+3

Source: https://habr.com/ru/post/1546152/


All Articles