Drupal-check.org - page load http://www.drupal-check.org/check/25 en Reduce HTTP requests http://www.drupal-check.org/node/61 <p>Go to <strong>Site configuration</strong> &gt; <strong>Performance</strong>, in <strong>Bandwidth optimizations</strong> section:</p> <ul> <li>Set <strong>Optimize CSS files</strong> to <strong>Enabled</strong></li> <li>Set <strong>Optimize JavaScript files</strong> to <strong>Enabled</strong></li> <li>Save your settings</li> </ul> <p>It is recommended to put JavaScript files at the bottom of your document (i.e. your theme <span class="geshifilter"><code class="text geshifilter-text">page.tpl.php</code></span>). Here is an example with Garland, but it should be the same with other themes. Search for the line <span class="geshifilter"><code class="text geshifilter-text">&lt;?php print $scripts ?&gt;</code></span>:</p> <p><div class="geshifilter"><div class="drupal6 geshifilter-drupal6" style="font-family:monospace;">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$language</span>-<span style="color: #66cc66;">&gt;</span><span style="color: #006600;">language</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; lang=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$language</span>-<span style="color: #66cc66;">&gt;</span><span style="color: #006600;">language</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; dir=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$language</span>-<span style="color: #66cc66;">&gt;</span><span style="color: #006600;">dir</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<br /> &nbsp; &lt;head&gt;<br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$head</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br /> &nbsp; &nbsp; &lt;title&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$head_title</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;<br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$styles</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$scripts</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br /> &nbsp; &lt;/head&gt;</div></div></p> <p>Cut and paste it just <strong>before</strong> the <span class="geshifilter"><code class="text geshifilter-text">&lt;?php print $closure ?&gt;</code></span> statment and before the closing <span class="geshifilter"><code class="text geshifilter-text">&lt;/body&gt;</code></span> tag, as shown below:</p> <p><div class="geshifilter"><div class="drupal6 geshifilter-drupal6" style="font-family:monospace;">&nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$scripts</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br /> &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$closure</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br /> &nbsp; &lt;/body&gt;<br /> &lt;/html&gt;</div></div></p> Optimization bandwidth optimizations page load Drupal 5.x Drupal 6.x Fri, 12 Jun 2009 15:14:05 +0000 jchatard 61 at http://www.drupal-check.org