CSS/JS Minification/combine breaks site
-
Site is all updated across the board.
every time i enable minify or combine for css or js I start getting a bunch of errors and it breaks the layout of the site. I’ve turned off the theme’s minify/combine function and tested, i’ve disabled the CDN and tested. tried varying combinations of settings and it all boils down to litespeed cache breaking things.
-
Please give the error info in your developer tool. Or give some more details so we can help. Without details we can’t do anything.
I turned css/js minify/combine and async css and defer js all back on.
The minified js/css shows 404:
https://www.hawksdesign.com/min/5644a.js
Please check php error log and your .htaccess. Is your server OpenLiteSpeed or Enterprise?
I have no idea on the version of litespeed. Is there an easy way to tell without contacting the host?
2017-10-10 19:16:20.612 [INFO] [108.162.245.168:16953] File not found [/home/user/public_html/min/css_async.js]
2017-10-10 19:16:20.600 [INFO] [108.162.245.246:10621] File not found [/home/user/public_html/min/2aeae.css]
2017-10-10 19:16:20.597 [INFO] [108.162.245.60:29339] File not found [/home/user/public_html/min/5644a.js]
2017-10-10 19:16:20.592 [INFO] [108.162.246.241:35265] File not found [/home/user/public_html/min/6b310.js]Based on that – it appears the plugin is saying that it is creating files in public_html/min/ but unfortunately that directory is neither created, nor is it populated and not throwing any errors indicating any of that.
Our cache plugin doesn’t need physical folder.
Please check your .htaccess. The rewrite rule didn’t affect.
Also, what is your wordpress permalink setting?
Permalink: Post name https://www.hawksdesign.com/sample-post/
I don’t have w3tc installed anymore, but I kept the browser caching part. I’ve also noticed that the ls cache plugin seems to be creating quite a bit of backups to htaccess – does it do that every time it’s activated/deactivated?
htaccess:
# BEGIN LSCACHE
## LITESPEED WP CACHE PLUGIN – Do not edit the contents of this block! ##
<IfModule LiteSpeed>
RewriteEngine on
CacheLookup on
RewriteRule .* – [E=Cache-Control:no-autoflush]
RewriteRule min/\w+\.(css|js) – [E=cache-control:no-vary]### marker CACHE RESOURCE start ###
RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php – [E=cache-control:max-age=3600]
### marker CACHE RESOURCE end ###### marker FAVICON start ###
RewriteRule favicon\.ico$ – [E=cache-control:max-age=86400]
### marker FAVICON end ###</IfModule>
## LITESPEED WP CACHE PLUGIN – Do not edit the contents of this block! ##
# END LSCACHE# BEGIN Force www & https
# This should be the first rule before other rules
# Redirects example.com and https://www.example.com to https://www.example.com
# [NC] flag makes it so the url is not case sensitive so example.com will be treated the same as EXamPLe.com
# [R=301,L] flag makes it do a 301 permanent redirect which is recommended<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule><IfModule LiteSpeed>
php_value auto_prepend_file ‘/home/hawksdes/public_html/wordfence-waf.php’
</IfModule>
<Files “.user.ini”><IfModule mod_authz_core.c>
Require all denied
</IfModule><IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule># BEGIN W3TC Browser Cache
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
AddType text/html .html .htm
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
AddType text/xml .xml
AddType video/asf .asf .asx .wax .wmv .wmx
AddType video/avi .avi
AddType image/bmp .bmp
AddType application/java .class
AddType video/divx .divx
AddType application/msword .doc .docx
AddType application/vnd.ms-fontobject .eot
AddType application/x-msdownload .exe
AddType image/gif .gif
AddType application/x-gzip .gz .gzip
AddType image/x-icon .ico
AddType image/jpeg .jpg .jpeg .jpe
AddType application/json .json
AddType application/vnd.ms-access .mdb
AddType audio/midi .mid .midi
AddType video/quicktime .mov .qt
AddType audio/mpeg .mp3 .m4a
AddType video/mp4 .mp4 .m4v
AddType video/mpeg .mpeg .mpg .mpe
AddType application/vnd.ms-project .mpp
AddType application/x-font-otf .otf
AddType application/vnd.ms-opentype .otf
AddType application/vnd.oasis.opendocument.database .odb
AddType application/vnd.oasis.opendocument.chart .odc
AddType application/vnd.oasis.opendocument.formula .odf
AddType application/vnd.oasis.opendocument.graphics .odg
AddType application/vnd.oasis.opendocument.presentation .odp
AddType application/vnd.oasis.opendocument.spreadsheet .ods
AddType application/vnd.oasis.opendocument.text .odt
AddType audio/ogg .ogg
AddType application/pdf .pdf
AddType image/png .png
AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
AddType audio/x-realaudio .ra .ram
AddType application/x-shockwave-flash .swf
AddType application/x-tar .tar
AddType image/tiff .tif .tiff
AddType application/x-font-ttf .ttf .ttc
AddType application/vnd.ms-opentype .ttf .ttc
AddType audio/wav .wav
AddType audio/wma .wma
AddType application/vnd.ms-write .wri
AddType application/font-woff .woff
AddType application/font-woff2 .woff2
AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
AddType application/zip .zip
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css A31536000
ExpiresByType text/x-component A31536000
ExpiresByType application/x-javascript A31536000
ExpiresByType application/javascript A31536000
ExpiresByType text/javascript A31536000
ExpiresByType text/x-js A31536000
ExpiresByType text/html A30
ExpiresByType text/richtext A30
ExpiresByType image/svg+xml A30
ExpiresByType text/plain A30
ExpiresByType text/xsd A30
ExpiresByType text/xsl A30
ExpiresByType text/xml A30
ExpiresByType video/asf A31536000
ExpiresByType video/avi A31536000
ExpiresByType image/bmp A31536000
ExpiresByType application/java A31536000
ExpiresByType video/divx A31536000
ExpiresByType application/msword A31536000
ExpiresByType application/vnd.ms-fontobject A31536000
ExpiresByType application/x-msdownload A31536000
ExpiresByType image/gif A31536000
ExpiresByType application/x-gzip A31536000
ExpiresByType image/x-icon A31536000
ExpiresByType image/jpeg A31536000
ExpiresByType application/json A31536000
ExpiresByType application/vnd.ms-access A31536000
ExpiresByType audio/midi A31536000
ExpiresByType video/quicktime A31536000
ExpiresByType audio/mpeg A31536000
ExpiresByType video/mp4 A31536000
ExpiresByType video/mpeg A31536000
ExpiresByType application/vnd.ms-project A31536000
ExpiresByType application/x-font-otf A31536000
ExpiresByType application/vnd.ms-opentype A31536000
ExpiresByType application/vnd.oasis.opendocument.database A31536000
ExpiresByType application/vnd.oasis.opendocument.chart A31536000
ExpiresByType application/vnd.oasis.opendocument.formula A31536000
ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
ExpiresByType application/vnd.oasis.opendocument.text A31536000
ExpiresByType audio/ogg A31536000
ExpiresByType application/pdf A31536000
ExpiresByType image/png A31536000
ExpiresByType application/vnd.ms-powerpoint A31536000
ExpiresByType audio/x-realaudio A31536000
ExpiresByType image/svg+xml A31536000
ExpiresByType application/x-shockwave-flash A31536000
ExpiresByType application/x-tar A31536000
ExpiresByType image/tiff A31536000
ExpiresByType application/x-font-ttf A31536000
ExpiresByType application/vnd.ms-opentype A31536000
ExpiresByType audio/wav A31536000
ExpiresByType audio/wma A31536000
ExpiresByType application/vnd.ms-write A31536000
ExpiresByType application/font-woff A31536000
ExpiresByType application/font-woff2 A31536000
ExpiresByType application/vnd.ms-excel A31536000
ExpiresByType application/zip A31536000
</IfModule># BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
I just noticed your detail pages can’t be opened. The WP’s original rewrite rule failed.
I just redid permalinks and other pages aren’t loading still. However – if i disable all the minify/combine stuff in the ls cache plugin the site works and operates just as it should.
https://www.hawksdesign.com/services/
I don’t think so. Its still 404
Yeah – i noticed. freaking fantastic… now permalinks is freaking broken and won’t work unless i set to plain.
Without permalink set correctly, optimizer won’t work.
alright – so i’ve completely rebuilt the htaccess file (for like the umpteenth time in the past 24 hours) and permalinks work, css/js min/combine works… defer js throws an error though and async css i think i’m going to throw out the window because it causes the page(s) to load horribly funky for a sec before showing right.
defer js errors:
(index):142 Uncaught ReferenceError: jQuery is not defined
at (index):142
(anonymous) @ (index):142
(index):142 Uncaught ReferenceError: jQuery is not defined
at (index):142
(anonymous) @ (index):142
(index):144 Uncaught ReferenceError: jQuery is not defined
at (index):144
(anonymous) @ (index):144
(index):145 Uncaught ReferenceError: jQuery is not defined
at (index):145I just visited your site but didn’t meet that error. Is everything ok?
That’s because you quit replying so i turned off deferring of js.
deferring is back on and errors are back.
Still didn’t see any error.
Also, as its not about js/css minify/combine, if you keep getting the error, can you create a separate topic? Thanks.
I assume css/js minify/combine works.
- The topic ‘CSS/JS Minification/combine breaks site’ is closed to new replies.