gzip compression

Status
Not open for further replies.

mikelons

New Member
Messages
16
Reaction score
0
Points
1
Is gzip compression enabled in the litespeed.config? I'd like to serve compressed files but unable to. If it is how can I go about setting it in the .htaccess file?

This is what I have in my .htaccess file at the moment:

Code:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

I've also tried:
Code:
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|xml|txt|css|js)$
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>
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Everything should be dynamically gzipped already by default. (Unfortunately, that also includes image files, so they tend to be slightly larger in transit than they would have been if left alone, by a couple of percent.)
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Earlier today, Gzip compression on certain free hosting servers was temporarily disabled due to a huge amount of problems it was causing on the server. Staff are currently looking into the root cause of why Gzip was causing so many problems.

Thank you,
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
We're actually just running some final checks to make sure Litespeed has been patched correctly, and it will be re-enabled on xo2/3.

However, you're on xo1.. So dynamic compression is already enabled and working.
 

mikelons

New Member
Messages
16
Reaction score
0
Points
1
Does that include svg images? I amended my code to include that but according to page speed insights (https://developers.google.com/speed/pagespeed/insights/?url=mikelonsdale.co.uk) svg is the only format not compressed.

Updated code:
Code:
# BEGIN GZIP
# mod_gzip compression (legacy, Apache 1.3)
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|xml|txt|css|js|svg|woff)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_include mime ^image/.*
mod_gzip_item_include rspheader ^Content-Encoding:.*gzip.*
</IfModule>
# END GZIP

# DEFLATE compression
<IfModule mod_deflate.c>
# Set compression for: html,txt,xml,js,css,svg,woff
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript application/x-font-woff image/svg+xml

# Deactivate compression for buggy browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

# Set header information for proxies
Header append Vary User-Agent
</IfModule>
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
SVG images weren't being compressed. I added it to the compression list.
In addition, our level for compression was set to a max of 1M (so we don't cache/compress massive images/files). I've increased this to 2M to accommodate your SVG image.
 

oscartst

New Member
Messages
1
Reaction score
0
Points
1
Hey @leafypiggy , i am on xo1 Server and tried activating Gzip compression in cPanel, however i am unable to activate it, tried testing the site with gzip verifiers and they all said Gzip was not activated, am i going to have to do it manually with the .htaccess file?
 
Status
Not open for further replies.
Top