0

I'm using Litespeed plugin for wordpress (From LiteSpeed Technologies), with a litespeed server, and despite what I do, it is not compressing javascript and css, and there's no option in the plugin for setting up "js & css" by the way. I already tried using other plugins, so I don't think the problem is the plugin, it's something in my server. I tried editing the following files usr/local/lsws/conf/httpd-tuning.conf and /usr/local/directadmin/custombuild/configure/openlitespeed/conf/httpd-tuning.conf

Changed the compression level, and yet I can't put this thing to compress. Yes, it is working, but it's only compressing text and html.

Even after changing the headers in the files from text/*, application/x-javascript, application/xml, application/javascript, image/svg+xml,application/rss+x$

to

text/*, application/x-javascript, application/xml, application/javascript, text/html, text/css, text/plain, text/xml, text/x-js, text/js, text/javascript

it still will not work.

Yes, I restart lightspeed every time I make changes, I can even see from the litespeed server administration that the new headers were applied. I believe it might be something else. I saw someone saying he said the same problem and his problem was the wildcard (besides the headers), but I don't know what that means.

Brave Warrior
  • 33
  • 1
  • 9
  • LScache only caches dynamic page, like PHP , it doesn't cache any static resources – qtwrk Jun 04 '21 at 16:30
  • I'm using a litespeed server and I don't have any better alternative at my hosting, what should I do to compress js and css then? – Brave Warrior Jun 04 '21 at 21:45
  • yeah well , "compress" and "cache" are 2 different concept , compress should be default enabled already , what do you see on your JS/CSS file response header? – qtwrk Jun 04 '21 at 23:47
  • I've read like 3 tutorials and they always tell to check the response headers, but I can't find the responses that they suggest. I tried searching for litespeed in the headers, as suggested by one of litespeed tutorials, and I couldn't find anything. Can you check the headers and tell me? This is the url: https://lucrebem.com.br/evoluir/aprender-rapido-melhor/ – Brave Warrior Jun 05 '21 at 00:00
  • https://i.stack.imgur.com/kgsHk.png https://i.stack.imgur.com/rGI78.png , they are already gzip'ed – qtwrk Jun 05 '21 at 03:36
  • Are there anymore js/css files being compressed and what method you used to find the headers? – Brave Warrior Jun 05 '21 at 07:42
  • from what I see , all of them are gzip'ed , chrome browser dev tool for header – qtwrk Jun 06 '21 at 00:14
  • I've noticed that a lot of js and css files are not compressed because they use brotli, since my vps uses a free version of litespeed server, I don't have access to the user interface of Open Litespeed software, I can only edit things through ssh. Do you know which file should I edit to change brotli settings? I've read that brotli already come enabled by default, ok, but I need to customize things. – Brave Warrior Jun 06 '21 at 03:10
  • brotil is generally considered as a better compression , why you want to force it to be gzip'ed ? – qtwrk Jun 07 '21 at 01:18
  • I don't want to gzip brotli, I want to know how to set brotli compression. – Brave Warrior Jun 07 '21 at 07:55
  • what's your env ? from the conf path it looks like DirectAdmin ? – qtwrk Jun 08 '21 at 01:07
  • I'm using Direct Admin, yes sir. – Brave Warrior Jun 08 '21 at 02:17
  • So? Any updates? – Brave Warrior Jun 13 '21 at 22:26

1 Answers1

1

For OLS, you can either enable gzip or brotli compression. Please refer to https://openlitespeed.org/kb/using-gzip-brotli-compression/. Since you are using OLS on DirectAdmin, you have no ability to modify the value by logging in to OLS admin console(That's because DA's implenmatation of splitting conf files, you will need to modify the server level or virtual host level directly by adding directive(brStaticCompressLevel 0) there. By the way, question title is better to change to: (not about caching at all, it is about )"How to enable gzip compression instead of brotli compression on OLS + DA" to avoid confusing.

Jackson
  • 36
  • 2
  • I have made the changes as per your suggestion. But anyway, a lot of files are still not being compressed, even after making the changes. – Brave Warrior Jun 13 '21 at 22:26