{"id":56,"date":"2010-05-04T00:20:42","date_gmt":"2010-05-04T00:20:42","guid":{"rendered":"https:\/\/adeelejaz.com\/blog\/?p=56"},"modified":"2016-01-12T23:35:53","modified_gmt":"2016-01-12T23:35:53","slug":"make-websites-load-faster","status":"publish","type":"post","link":"https:\/\/adeelejaz.com\/blog\/make-websites-load-faster\/","title":{"rendered":"Quick and easy way to make websites load faster"},"content":{"rendered":"<p>This is just a quick post to quickly get you to improve your website&#8217;s speed if you are running an Apache web server.<\/p>\n<p>Create a .htaccess file (if one isn&#8217;t already present) and add the following lines at the end of the file:<\/p>\n<p><code lang=\"apache\"># GZip<br \/>\nAddOutputFilterByType DEFLATE text\/html text\/plain text\/xml text\/javascript text\/css<\/code><\/p>\n<p># Setting longer cache time<br \/>\nExpiresActive On<br \/>\nExpiresByType text\/css &#8220;now plus 1 month&#8221;<br \/>\nExpiresByType text\/javascript &#8220;now plus 1 month&#8221;<br \/>\nExpiresByType image\/gif &#8220;now plus 1 month&#8221;<br \/>\nExpiresByType image\/png &#8220;now plus 1 month&#8221;<br \/>\nExpiresByType image\/jpeg &#8220;now plus 1 month&#8221;<br \/>\nExpiresByType image\/x-icon &#8220;now plus 1 month&#8221;<\/p>\n<p>The first statement enables compression for HTML, plain text files, XML, JavaScript and CSS. Enabling compression means that the data is compressed before being transmitted. Less data to move means things can move along a lot quicker.<\/p>\n<p>The second set of statements enable caching by file types, namely on CSS, JavaScript, GIF, JPG and ICO. Now I&#8217;m using a cache expiry date of one month, but you can use anything that suits you.<\/p>\n<p>For example, if you make a lot of changes to the CSS and images, you might prefer files to expire after a day, in which case you can change it to:<\/p>\n<p><code lang=\"apache\">ExpiresByType text\/css \"now plus 1 day\"<\/code><\/p>\n<p>The <code>ExpiresByType<\/code> can take in a number of keywords like: years, months, weeks, days, hours, etc. For more info, check out <a href=\"http:\/\/httpd.apache.org\/docs\/2.0\/mod\/mod_expires.html#AltSyn\">Alternative Interval Syntax for ExpiresByType<\/a>.<\/p>\n<p>If you have anything to add, feel free to drop it in the comments and I&#8217;ll update the post.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content --><p class=\"wp-flattr-button\"><a href=\"https:\/\/adeelejaz.com\/blog\/?flattrss_redirect&amp;id=56&amp;md5=031cc8acf1e5e079dc5a8e1da50403c3\" title=\"Flattr\" target=\"_blank\"><img src=\"https:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white.png\" srcset=\"https:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white.png, https:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white@2x.png 2xhttps:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white.png, https:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white@3x.png 3x\" alt=\"Flattr this!\"\/><\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>This is just a quick post to quickly get you to improve your website&#8217;s speed if you are running an Apache web server. Create a .htaccess file (if one isn&#8217;t already present) and add the following lines at the end of the file: # GZip AddOutputFilterByType DEFLATE text\/html text\/plain text\/xml text\/javascript text\/css # Setting longer [&hellip;]<!-- AddThis Advanced Settings generic via filter on wp_trim_excerpt --><!-- AddThis Share Buttons generic via filter on wp_trim_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-apache"],"_links":{"self":[{"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":1,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":57,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions\/57"}],"wp:attachment":[{"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}