I am a noob! So, I need some help. I installed Openlitespeed WordPress from the Marketplace on a droplet with Ubuntu. I never had any idea that LSCache doesn’t have the option of GZIP compression. I want to enable it without using an additional plugin. Can anyone guide me? As I said, I am a noob. Some help with a simple explanation or a step-by-step guide will be really helpful.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @shivaranjanibaidya ,
I just want to provide some information here for OpenLiteSpeed gzip question.
The OpenLiteSpeed comes with both Gzip/Brotli compression enabled, so you don’t need to do anything. That’s why LSCache Plugin has no such feature.
FYI, Browser cache is also enabled by default on server level.
Best, Eric
Gzip compression is enabled by default if I’m not mistaken. Having said that it’s usually hidden by the PHP settings. You’ll need to edit the following line in your PHP.ini file
;zlib.output_compression_level = -1
You’ll need to enable it like so
zlib.output_compression_level = 1
After you do, you can restart apache/nginx and everything should be working.
As for the Gzip compression, as far as I know, OpenLiteSpeed supports .htaccess so you should be able to add the following in your .htaccess file for your website :
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
Regrads, KFSys
HI @shivaranjanibaidya ,
You can ignore the compression alert from Pingdom since they don’t support brotli from the first beginning. If you test on GTMetrix, all shows score A (98%). I also didn’t see any issue on Pagespeed Insights.
Currently your static files are served by cloudflare, so if you see “Serve static assets” again, you might want to look into your CDN settings.
Best, Eric
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.