{"id":302,"date":"2013-01-24T23:17:43","date_gmt":"2013-01-24T22:17:43","guid":{"rendered":"http:\/\/goranmitev.com\/?p=302"},"modified":"2020-05-18T16:11:25","modified_gmt":"2020-05-18T14:11:25","slug":"speed-up-your-website-with-the-perfect-htaccess-file","status":"publish","type":"post","link":"https:\/\/goranmitev.com\/blog\/speed-up-your-website-with-the-perfect-htaccess-file","title":{"rendered":"Speed up your website with the perfect .htaccess file"},"content":{"rendered":"<p>I was doing some research about the guidelines that Google and Yahoo offer for speeding up websites, and kind of found that the quickest thing that you could do is add a .htacces file to your document root of your project. With this quick trick you can speed up your website dramatically. Of course, I&#8217;m assuming the use of Apache web server which uses this file. This should give you a big boost in performance of your website and probably give you a score of almost 90 in <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/insights\">Google Page Speed test<\/a>.<!--more--><\/p>\n<pre># disable the server signature\nServerSignature Off\n\n# Enable compression\n&lt;IfModule mod_deflate.c&gt;\n&nbsp; &lt;FilesMatch \"\\.(js|css|php|eot|ttf|otf|svg)$\"&gt;\n&nbsp;&nbsp;&nbsp; SetOutputFilter DEFLATE\n&nbsp; &lt;\/FilesMatch&gt;\n&lt;\/IfModule&gt;\n\n# Control ETags which is thought that bring better performance\n&lt;IfModule mod_headers.c&gt;\n&nbsp;&nbsp;&nbsp; Header unset ETag\n&lt;\/IfModule&gt;\nFileETag None\n\n&lt;IfModule mod_headers.c&gt;\n&nbsp; &lt;FilesMatch \"\\.(js|css|xml|gz)$\"&gt;\n&nbsp;&nbsp;&nbsp; Header append Vary Accept-Encoding\n&nbsp; &lt;\/FilesMatch&gt;\n&lt;\/IfModule&gt;\n\n&lt;IfModule mod_expires.c&gt;\n\n&nbsp;&nbsp; &nbsp;# Enable expirations\n&nbsp;&nbsp; &nbsp;ExpiresActive On\n\n&nbsp;&nbsp; &nbsp;# Default directive\n&nbsp;&nbsp; &nbsp;ExpiresDefault \"access plus 1 month\"\n\n&nbsp;&nbsp; &nbsp;# My favicon\n&nbsp;&nbsp; &nbsp;ExpiresByType image\/x-icon \"access plus 1 year\u201d\n\n&nbsp;&nbsp; &nbsp;# Images\n&nbsp;&nbsp; &nbsp;ExpiresByType image\/gif \"access plus 1 month\"\n&nbsp;&nbsp; &nbsp;ExpiresByType image\/png \"access plus 1 month\"\n&nbsp;&nbsp; &nbsp;ExpiresByType image\/jpg \"access plus 1 month\"\n&nbsp;&nbsp; &nbsp;ExpiresByType image\/jpeg \"access plus 1 month\"\n\n&nbsp;&nbsp; &nbsp;# CSS\n&nbsp;&nbsp; &nbsp;ExpiresByType text\/css \"access 1 month\u201d\n\n&nbsp;&nbsp; &nbsp;# Javascript\n&nbsp;&nbsp; &nbsp;ExpiresByType application\/javascript \"access plus 1 year\"\n\n&lt;\/IfModule&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was doing some research about the guidelines that Google and Yahoo offer for speeding up websites, and kind of found that the quickest thing that you could do is add a .htacces file to your document root of your project. With this quick trick you can speed up your website dramatically. Of course, I&#8217;m [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,9,4],"tags":[20],"_links":{"self":[{"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/posts\/302"}],"collection":[{"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/comments?post=302"}],"version-history":[{"count":18,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/posts\/302\/revisions"}],"predecessor-version":[{"id":397,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/posts\/302\/revisions\/397"}],"wp:attachment":[{"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/media?parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/categories?post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/tags?post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}