Re: Apache24 - how to optimize httpd.conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





From Apache point of view...
  • Don't use .htaccess files... put everything in httpd.conf (or equivalent) there is a huge file system performance hit {Apache has to look for .htaccess files in the directory and any parent directories}
    include "AllowOverride None" in httpd.conf
  • Remove etags (Header unset Etag/FileETag None)
  • Enable keepalive
  • Turn on gzip encoding {mod_deflate} which you have done
  • Auto set expiry dates into the future {mod_expires}:
    ExpiresActive On / ExpiresDefault "access plus 366 day" / Header append Cache-Control "public"
    for static content...

Additionally...

  • For images look at:    optipng, jpegoptim & advpng... {consider spriting if useful}
  • For minifying CSS/JS: look at yui compressor and google closure compiler...  (Use jshint to check your js to make sure that it will merge/compress OK)
  • Can use a number of build tools to do some of this auto-magically...
  • Move (most) JS to the foot of the page....

Watch out with minifying HTML - there is a minor bug with most of the minifiers which which can't handle correctly ends of line after tags, and if you have gzip encoding it usually doesn't make a difference!

Finally...

  • Look at your code and try and optimize your HTML { put as much presentation as possible into CSS }
  • Look at your JS - don't use multiple "library classes" - I have seen sites using jQuery, Scriptaculous and YUI at the same time!

On 08/06/2015 22:43, Motty Cruz wrote:
Hello,
I added this code on .htaccess
<IfModule mod_mime.c>
 AddType application/x-_javascript_ .js
 AddType text/css .css
</IfModule>
<IfModule mod_deflate.c>
 AddOutputFilterByType DEFLATE text/css application/x-_javascript_ text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/_javascript_
 <IfModule mod_setenvif.c>
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
 </IfModule>
 <IfModule mod_headers.c>
  Header append Vary User-Agent env=!dont-vary
 </IfModule>
</IfModule>

does not seem to make a difference!



On 06/08/2015 02:38 PM, Emir Ibrahimbegovic wrote:
What have you tried?

On Mon, Jun 8, 2015 at 5:35 PM, Motty Cruz <motty.cruz@xxxxxxxxx> wrote:
Hello,
I am getting the following suggestions from:
https://developers.google.com/speed/pagespeed/insights/


Should Fix:
Optimize images
Leverage browser caching
Consider Fixing:
Eliminate render-blocking _javascript_ and CSS in above-the-fold content
Minify CSS
Minify HTML

What is the best practice to solve errors above?

Thanks,

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





-- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux