Magento Optimized htaccess

                                  Magento Optimized htaccess


The following htaccess entries are the optimized htaccess for a Magento, it will speedup your site upto 20%.
I have tested this htaccess in few sites and i have found that the speed of the site increased by 20%. You can also view the performance of your site after adding this site using the following link.

https://developers.google.com/speed/pagespeed/insights/

Feel the difference and optimize your site easily just by adding this, If you are getting more than 80% for your site in the above page speed test, it a good result.


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

## enable apache served files compression (not php, html/images/css/js

## http://developer.yahoo.com/performance/rules.html#gzip

<IfModule mod_deflate.c>

          # 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

          # 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

</IfModule>

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

## Enable keep-alives to reduce # http requests

<ifModule mod_headers.c>

            Header set Connection keep-alive

</ifModule>

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

## Add default Expires header

## http://developer.yahoo.com/performance/rules.html#expires

<IfModule mod_expires.c>

# Turn on Expires and set default to 0

            ExpiresActive On

            ExpiresDefault A0

            # Set up caching on media files for 1 year (forever?)

            ExpiresDefault A29030400

            Header append Cache-Control "public"

            # Set up caching on media files for 2 weeks

            ExpiresDefault A1209600

            Header append Cache-Control "public"

            # Set up 1 week caching on commonly updated files

            ExpiresDefault A604800

            Header append Cache-Control "proxy-revalidate"

            # Force no caching for dynamic files

            ExpiresActive Off

            Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"

            Header set Pragma "no-cache"

</IfModule>

Header unset Pragma
Header unset ETag
FileETag None

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


Hope this helped....

This entry was posted by Unknown. Bookmark the permalink.

33 thoughts on “Magento Optimized htaccess”

  1. Attend The Python Training in Bangalore From ExcelR. Practical Python Training in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python Training in Bangalore.

  2. Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here.
    Data Science Courses

  3. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us


    You will get an introduction to the Python programming language and understand the importance of it. How to download and work with Python along with all the basics of Anaconda will be taught. You will also get a clear idea of downloading the various Python libraries and how to use them.
    Topics
    About ExcelR Solutions and Innodatatics
    Do's and Don’ts as a participant
    Introduction to Python
    Installation of Anaconda Python
    Difference between Python2 and Python3
    Python Environment
    Operators
    Identifiers
    Exception Handling (Error Handling)
    Excelr Solutions