Sending compressed HTML/JS/CSS pages

I heard a rumor that if webpages are compressed before being delivered, it would save mobile users some time…

I tried to add some lines to my .htaccess file to do this…but the server didn’t like me afterwards, so I took them out.

Any info on doing this new fangled compression stuff?

z

On a number of servers compression is already enabled and on, the htacess method should also work, but it is super picky about syntax and all, so even if minor error it would come back at you with error/blank page. You have a ticket about which domain? One of linux guys can take a look.

Thank you Stephen!!

Website is DDAmanda.com

This is what I tried to add to my .htaccess file

compress text, HTML, JavaScript, CSS, and XML

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

remove browser bugs

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

Here’s another version I found:

compress text, html, javascript, css, xml:

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

Or, compress certain file types by extension:

<files *.html>
SetOutputFilter DEFLATE

But I’d actually rather use GZip than Deflate…fwtfw

Also I’m on a semi dedicated server…

HEY…I just found this…gonna try it:

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.*

z

OK…Tried the stuff I just found…at the bottom of last post.

This site says it’s still not compressed: http://aruljohn.com/gziptest.php

[SIZE=5]Results for http://ddamanda.com/ [/SIZE]
[SIZE=3]This page is NOT gzipped[/SIZE]
Original size is 27.14 kb (27787 bytes)

This page could be compressed to 7.44 kb (7617 bytes)

The bandwidth saving would be about 72.59 %

z

WAITTTTTTTTTTTT

Found a different site that says it’s compressed:

BUT:

OK…That site is being blocked by the server…notice the 475 byte length…that’s cause I DENY certain IP addresses and give them a fake 404 page…

http://www.gziptest.com/

[SIZE=6]Gzip Test : ddamanda.com[/SIZE]
[SIZE=5]upload_2016-9-26_10-39-6.png YES, it’s GZIP enabled![/SIZE]
[SIZE=4]Technical details:[/SIZE]
Date : Mon, 26 Sep 2016 17:37:55 GMT

Server : Apache

Last-Modified : Mon, 11 Jan 2016 23:44:28 GMT

ETag : “1ca0f8-1db-52917848e35fa”

Accept-Ranges : bytes

Content-Length : 475

Connection : close

Content-Type : text/html

z

This site also says it’s Not compressed…Judging from the size, I’d say it’s not compressed…

GIDZipTest: Web Page Compression (Deflate / Gzip) Test - GIDNetwork

[SIZE=5]Results for: http://ddamanda.com [/SIZE]
Web page compressed? No
Compression type? none
Size, Markup (bytes) 27,604
Size, Compressed (bytes) 27,604
Compression % 0.0

We recommend you to switch this website to a latest available PHP version 5.5 and then check compression.

This site is on a Semi Dedicated Server…how do I switch to PHP 5.5…that’s your job correct?

Ans how does the PHP version affect .htaccess directives to Apache?

I guess I should put in a Support Ticket…just wanted to make others aware that their sites can load faster on mobile devices with compression…

z