Brotli/gzip Compression enabled but not working?

#1
It looks like that brotli is not compressing all my local static content (and I need it to compress at least all local js and css files) or that it's gzip that isn't working. And maybe there's nothing being compressed at all, because I'm getting like 8mb of page size and gzip might also be the problem, but I also believe that there's something else in my server that is making this a mess. Someone said in a forum that `mod_pagespeed` might be a problem, but when I've checked if it was installed, it isn't, at least I couldn't find the path described in the tutorial, I don't have a `modules` folder in my root folder.

I'm using these headers:

compressibleTypes text/*,application/x-javascript,application/javascript,application/xml,application/json,application/ld+json,application/rdf+xml,application/rss+xml,application/schema+json,application/manifest+json,application/vnd.ms-fontobject,application/vnd.geo+json,application/x-font,application/x-font-opentype,application/x-font-otf,application/x-font-truetype,application/x-font-ttf,application/xhtml+xml,application/x-web-app-manifest+json,image/svg+xml,image/x-icon,image/vnd.microsoft.icon,image/bmp,font/eot,font/opentype,font/otf,font/ttf


This is my `httpd-tuning.conf` content:

tuning{
maxConnections 10000
maxSSLConnections 5000
connTimeout 300
maxKeepAliveReq 10000
smartKeepAlive 0
keepAliveTimeout 5
sndBufSize 0
rcvBufSize 0
gzipStaticCompressLevel 9
gzipMaxFileSize 10M
eventDispatcher best
maxCachedFileSize 4096
totalInMemCacheSize 20M
maxMMapFileSize 256K
totalMMapCacheSize 40M
useSendfile 1
fileETag 28
SSLCryptoDevice null
maxReqURLLen 8192
maxReqHeaderSize 16380
maxReqBodySize 2047M
maxDynRespHeaderSize 8192
maxDynRespSize 2047M
enableGzipCompress 1
enableBrCompress 1
enableDynGzipCompress 1
gzipCompressLevel 9
brStaticCompressLevel 11
compressibleTypes text/*,application/x-javascript,application/javascript,application/xml,application/json,application/ld+json,application/rdf+xml,application/rss+xml,application/schema+json,application/manifest+json,application/vnd.ms-fontobject,application/vnd.geo+json,application/x-font,application/x-font-opentype,application/x-font-otf,application/x-font-truetype,application/x-font-ttf,application/xhtml+xml,application/x-web-app-manifest+json,image/svg+xml,image/x-icon,image/vnd.microsoft.icon,image/bmp,font/eot,font/opentype,font/otf,font/ttf
gzipAutoUpdateStatic 1
gzipMinFileSize 300
}


Whatever I check with whatever online tool, it says that brotli is not supported and that gzip is supported, but then I check one of the files directly, and it says brotli is supported.
I'm running Direct Admin on a CentOS, using the free version of Litespeed.

This is the page that I'm testing: https://lucrebem.com.br/emp/respondendo-estonia-01/
the one the tool says that gzip is enabled, but brotli is not supported. And this is the file that the tool says that brotli is supported:
https://lucrebem.com.br/wp-includes/js/wp-emoji-release.min.js

I don't know if that serves much of an info, but I've noticed that when I do changes to my htaccess, they only go into effect after I restart litespeed, so maybe there's something that's caching my server files, thus preventing me from seeing changes right away.
 
#2
Should I reformulate the topic? Basically I just need to know why compression isn't working at all, although it was activated in the configuration file.
 

Cold-Egg

Administrator
#3
LSCache won't cache static files. LSWS/OLS has both gzip and brotli enabled by default, so no need to change it.
You can verify it from your browser tool.
br.png
 
#4
Just found that LiteSpeed Cache Page Optimization's CSS & JS minify, as well as all its other options, were disabled. Maybe that's the problem?
I'm saying "maybe" because when I try to enable and save those options, I'm getting this error:

This page isn’t working
If the problem continues, contact the site owner.
HTTP ERROR 406

This happened yesterday after I installed Litespeed Cache plugin from this tutorial https://docs.litespeedtech.com/cp/directadmin/configuration/, then it tells to install mod_security too (Set up ModSecurity Rules for LiteSpeed with DirectAdmin), I'm not sure why, because I'm not using Apache, but I installed it anyway.
 
#5
I managed to get rid of the error by disabling mod_security, but anyway, the compression is not working, even after enabling CSS & JS minify.
If I disable Litespeed plugin I get the same page size as if it was enabled, so it means that compression is not working.
 

Cold-Egg

Administrator
#6
The CSS&JS optimization features are different from the compression.
I just checked again, still able to see either br or gzip compression from my browser. Do you have any screenshots or links for how you compare the page size?
 

Cold-Egg

Administrator
#9
Spam removed.
For the compression checking purpose, I'd recommend not to use the Pingdom tool to check since they did not support brotli from day one.
 

Cold-Egg

Administrator
#11
I just checked your video and confirmed it's two different topics.
First, we've confirmed Brotli/gzip Compression works on either browser or page speed tools.

From my understanding, now your question is why css and js optimization not working?
Please try the following steps with GTmetrix in the same location.
1. Purge all cache, disable LSCache.
2. Run the GTmetrix and share the Page Details here, e.g. Size of JS and CSS in numbers.
3. Enable LSCache, visit the page and make sure css/js optimization works.
4. Run the GTmetrix and share the Page Details here, e.g. Size of JS and CSS in numbers
 
#13
I just checked your video and confirmed it's two different topics.
First, we've confirmed Brotli/gzip Compression works on either browser or page speed tools.

From my understanding, now your question is why css and js optimization not working?
Please try the following steps with GTmetrix in the same location.
1. Purge all cache, disable LSCache.
2. Run the GTmetrix and share the Page Details here, e.g. Size of JS and CSS in numbers.
3. Enable LSCache, visit the page and make sure css/js optimization works.
4. Run the GTmetrix and share the Page Details here, e.g. Size of JS and CSS in numbers
Here you go:

 

Cold-Egg

Administrator
#14
Hi,
You still not follow. Anyway, here's the way I saw your site optimize and non-optimized look like.

Optimized: 269 req 17.9MB all br/gzip
optimize-1.png

Non-Optimized: 288 req 19.3MB all br/gzip
nooptimize-1.png

Compare the minified css and non-minified css.
comparecss.png

I think I can not help more if you still believe everything is not working.
 
#15
I don't believe anything, I just said that because either way disabling or enabling litespeed I was getting the same average page size from the tests, it doesn't mean that I'm not eager to do any changes. So what you mean with those requests? Are you telling me they're mostly external? I'm running a wordpress site.
 
#16
Alright, so lightspeed plugin can't handle plugins requests. Then there's no point in using this plugin if it's going to let like 95% of the files unattended. I don't see another alternative but to move back to Apache.
 
Top