Post by Andaho » Wed Mar 19, 2014 5:26 am

I want to enable gzip compression, but I have no idea what I'm doing...

I'm totally confused because I have read to do it 4 different ways! -

Code: Select all

Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2100 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/javascript text/plain text/xml application/xml text/css application/x-javascript application/javascript
</IfModule>

Code: Select all

# 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

Code: Select all

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

Code: Select all

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
All 4 are completely different! - can anyone help me understand the differences? - and which one is best to use?

New member

Posts

Joined
Wed Jul 10, 2013 4:15 am

Post by Andaho » Wed Mar 19, 2014 6:47 am

Ok, no reply yet :( I'm still reading about this for the last 2 hours...

I'm trying to put together the best of what I've barely learned... is this best to use?

Code: Select all

# gzip #
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/javascript text/plain text/xml application/xml text/css application/x-javascript application/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
</IfModule>
# gzip end #

New member

Posts

Joined
Wed Jul 10, 2013 4:15 am

Post by victorj » Wed Mar 19, 2014 6:59 am

Just go into admin select system settings server.
scroll down til you see gzip, enter a number of compression and save

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Eigen productie en snelle levering.
https://123-deurrubbers.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by Andaho » Wed Mar 19, 2014 7:02 am

victorj wrote:Just go into admin select system settings server.
scroll down til you see gzip, enter a number of compression and save
Yep, I did that, but it only compressed the root... all the css and js files were still uncompressed.

New member

Posts

Joined
Wed Jul 10, 2013 4:15 am

Post by Dunald » Thu Apr 10, 2014 8:31 pm

Did you get a solution to the css and js compression? I also have the same problem, please advice.

Active Member

Posts

Joined
Tue Mar 15, 2011 9:05 pm

Post by Andaho » Thu Apr 10, 2014 8:45 pm

Dunald wrote:Did you get a solution to the css and js compression? I also have the same problem, please advice.
Hi Dunald,

I used the following code for setting cache and gzip compression:

Code: Select all

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 week"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 month"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

# gzip #
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/javascript text/plain text/xml application/xml text/css application/x-javascript application/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
</IfModule>
# gzip end #

New member

Posts

Joined
Wed Jul 10, 2013 4:15 am
Who is online

Users browsing this forum: No registered users and 13 guests