Tag Archives: Disable ETags in magento

Magento site speed up through htaccess

There are few step to speed up the site through htaccess.

Step 1: Gzip Compression For Magento

## enable resulting html compression
    php_flag zlib.output_compression on

Step2: (optional) Compressing CSS and JavaScript files

############################################

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

</files>
############################################

Step3: Leverage Browser Caching and Expires Headers

Leverage Browser Caching and Expires Headers. This code will reduce the number of HTTP request.

##

<IfModule mod_expires.c>

# Enable expirations

ExpiresActive On

# Default directive

ExpiresDefault "access plus 1 month"

# My favicon

ExpiresByType image/x-icon "access plus 1 year?

# Images

ExpiresByType image/gif "access plus 1 month"

ExpiresByType image/png "access plus 1 month"

ExpiresByType image/jpg "access plus 1 month"

ExpiresByType image/jpeg "access plus 1 month"

# CSS

ExpiresByType text/css "access 1 month?

# Javascript

ExpiresByType application/javascript "access plus 1 year"

</IfModule>

############################################

Step4: Disable ETags

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags
 
    FileETag none

Step5: Enable Output Compression

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip
 
    # Insert filter on all content
    SetOutputFilter DEFLATE
    # Insert filter on selected content types only
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
 
    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html
 
    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
 
    # MSIE masquerades as Netscape, but it is fine
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
 
    # Don't compress images
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
 
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary