{"id":2528,"date":"2019-03-12T20:16:15","date_gmt":"2019-03-12T14:46:15","guid":{"rendered":"https:\/\/www.idslogic.com\/blog\/?p=2528"},"modified":"2025-02-25T11:00:43","modified_gmt":"2025-02-25T05:30:43","slug":"how-to-optimize-your-drupal-7-website-performance","status":"publish","type":"post","link":"https:\/\/www.idslogic.com\/blog\/how-to-optimize-your-drupal-7-website-performance","title":{"rendered":"How to Optimize Your Drupal 7 Website Performance"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_72 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.idslogic.com\/blog\/how-to-optimize-your-drupal-7-website-performance\/#Devel_Module_to_the_Rescue\" title=\"Devel Module to the Rescue:\">Devel Module to the Rescue:<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.idslogic.com\/blog\/how-to-optimize-your-drupal-7-website-performance\/#Slow_Query_Monitoring\" title=\"Slow Query Monitoring:\">Slow Query Monitoring:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.idslogic.com\/blog\/how-to-optimize-your-drupal-7-website-performance\/#XHPROF_Profiling\" title=\"XHPROF Profiling:\">XHPROF Profiling:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.idslogic.com\/blog\/how-to-optimize-your-drupal-7-website-performance\/#Other_features_include\" title=\"Other features include:\">Other features include:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.idslogic.com\/blog\/how-to-optimize-your-drupal-7-website-performance\/#Image_Optimization\" title=\"Image Optimization:\">Image Optimization:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.idslogic.com\/blog\/how-to-optimize-your-drupal-7-website-performance\/#Site_Cache\" title=\"Site Cache:\">Site Cache:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.idslogic.com\/blog\/how-to-optimize-your-drupal-7-website-performance\/#Search_Optimization\" title=\"Search Optimization:\">Search Optimization:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.idslogic.com\/blog\/how-to-optimize-your-drupal-7-website-performance\/#Other_Methods\" title=\"Other Methods:\">Other Methods:<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Devel_Module_to_the_Rescue\"><\/span><span style=\"color: #003300;\"><strong>Devel Module to the Rescue:<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Slow_Query_Monitoring\"><\/span><span style=\"color: #008080; font-size: 16pt;\"><strong>Slow Query Monitoring:<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Slow query is the type of SQL query that takes more time to execute. These types of queries can be optimized to increase the performance of the site.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">To do this, enable the devel module and goto the admin\/config\/devel and enable the slow query option.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">This option will display all the SQL queries made for every page request and the most time consuming queries will be highlighted.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\">We can then identify them in all the pages of the site and optimize them.<br \/>\n<\/span><\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"XHPROF_Profiling\"><\/span><span style=\"color: #008080; font-size: 16pt;\"><strong>XHPROF Profiling:<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Another option available in the devel module settings page is the xhprof profiling.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">This profiling will give a detailed report on the whole performance of the site. Xhprof profiling is a high level profiling and is recommended only for advanced users as the wrong usage may affect the site behavior.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\">This option in not available at the go itself, you have to make some server side installations. For further queries, Please look into this link <\/span><u><u><span style=\"font-size: 14pt;\">http:\/\/www.pixelite.co.nz\/article\/profiling-drupal-7-performance-xhprof-and-devel\/<\/span><\/u><\/u><\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Other_features_include\"><\/span><span style=\"color: #008080;\"><strong><span style=\"font-size: 16pt;\">Other features include:<\/span><\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Display page execution time in the query log box.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Display memory usage<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Display redirection page<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\">Display page array Variable<\/span><\/li>\n<\/ol>\n<blockquote><p><span style=\"color: #333300; font-size: 18pt;\"><strong>*** All devel module settings must be used for development purpose only and must be disabled after usage.<\/strong><\/span><\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2536\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Devel-Module-to-the-Rescue.png\" alt=\"Drupal 7 Optimization\" width=\"1200\" height=\"200\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Devel-Module-to-the-Rescue.png 1200w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Devel-Module-to-the-Rescue-300x50.png 300w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Devel-Module-to-the-Rescue-768x128.png 768w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Devel-Module-to-the-Rescue-1024x171.png 1024w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Devel-Module-to-the-Rescue-560x93.png 560w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"Image_Optimization\"><\/span><span style=\"color: #003300;\"><strong><span style=\"font-size: 18pt;\">Image Optimization:<\/span><\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">The type of image format we are using can also affect the performance of the site as they can take time to load, based on the format.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Usage of modern formats like .png or .jpg are highly recommended.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Another point to note is the size of the images. Size of images that don&#8217;t need to be of high quality can be reduced to bare minimum for faster loading.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\">Video format can also be changed to modern formats if your site uses videos<\/span><\/li>\n<\/ol>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"Site_Cache\"><\/span><span style=\"color: #003300;\"><strong><span style=\"font-size: 18pt;\">Site Cache:<\/span><\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Caching is the method of saving requests in the server and serving from that saved data instead of hitting the DB for every request, which can reduce the performance of the site.<\/span><\/span><\/li>\n<li><strong><em><span style=\"color: #008000;\"><span style=\"font-size: 14pt;\">Basic level of caching<\/span><\/span> <\/em><\/strong><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">can be done in the admin\/config\/performance page where we can enable caching for the anonymous users who will usually be seeing the same pages of the site and not dynamic pages.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">The cache retention time can also be specified here, which can be used to delete the cache periodically without human intervention.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\"><span style=\"color: #008000;\"><strong><em>Advanced level of caching <\/em><\/strong><\/span>can include using different services in the server level to cache the pages.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Services like Varnish and Pound can be installed in the server level and used to improve the site performance.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Caching systems can be a boon in cases of sites that have most of the content that don\u2019t change over time.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Minifying the CSS and JS using some module of your choice will also improve the speed of the site.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\">Upgrading to the latest version of bootstrap and also using newer technologies for styling like SASS can also improve the performance of the site.<\/span><\/li>\n<\/ol>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"Search_Optimization\"><\/span><span style=\"color: #003300;\"><strong>Search Optimization:<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">Nowadays, all sites have inbuilt search in them. If your site uses search as an important feature, then we can use <span style=\"color: #008000;\"><strong><em>apache SOLR<\/em><\/strong><\/span> instead of the inbuilt default Drupal search.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">This will reduce the amount of load on the DB as user searches will not hit the DB directly. This will also improve the autocomplete of the searches.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\"><span style=\"font-size: 14pt;\">You can install the Apache SOLR module to leverage the SOLR abilities. This also needs some backend work like install tomcat and apache solr in the server and correctly configuring them.<\/span><\/span><\/li>\n<li><span style=\"font-size: 14pt;\">This will index the whole site and help make the search faster.<\/span><\/li>\n<\/ol>\n<p><a href=\"https:\/\/www.idslogic.com\/drupal-maintenance-and-support\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2530\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Drupal-support-and-maintenance.png\" alt=\"Drupal-support-and-maintenance\" width=\"798\" height=\"300\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Drupal-support-and-maintenance.png 798w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Drupal-support-and-maintenance-300x113.png 300w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Drupal-support-and-maintenance-768x289.png 768w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/03\/Drupal-support-and-maintenance-560x211.png 560w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><br \/>\n<\/a><\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"Other_Methods\"><\/span><span style=\"color: #003300;\"><strong>Other Methods:<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-size: 14pt;\">We can also implement <span style=\"color: #008000;\"><strong><em>Lazy loading<\/em><\/strong><\/span> in the site to make sure the skeleton comes first instead of loading it fully on one go. This method is being used by Facebook that makes the site load faster.<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"font-size: 14pt;\"><a href=\"\/blog\/things-you-should-know-about-drupal-security-to-ironclad-your-website-from-attacks\"><span style=\"color: #800000;\">Things You Should Know About Drupal Security to Ironclad Your Website from Attacks<\/span><\/a><\/span><\/p>\n<p><span style=\"color: #800000; font-size: 14pt;\"><strong>Contributed By:<\/strong><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">Anand Kumar<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Devel Module to the Rescue: Slow Query Monitoring: Slow query is the type of SQL query that takes more time to execute. These types of queries can be optimized to increase the performance of the site. To do this, enable&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2529,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[256],"tags":[768,767,766],"class_list":["post-2528","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cms","tag-druapl-optimization","tag-drupal-7-optimization","tag-drupal-7-speed-optimization"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts\/2528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/comments?post=2528"}],"version-history":[{"count":12,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts\/2528\/revisions"}],"predecessor-version":[{"id":10709,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts\/2528\/revisions\/10709"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/media\/2529"}],"wp:attachment":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/media?parent=2528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/categories?post=2528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/tags?post=2528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}