N ideas to increase performance of website – Part 2

To get the basic idea please go through Part – 1.

  • On Page
    1. Image Optimization
      As a general rule of thumb, larger files take longer to download than smaller files. Web page download time, also known as the Page Load Time depends on the total size of content assets being downloaded from hosting servers to the requesting browser.The following image optimization best-practices go a long way in reducing the negative impact of images on website speed:

      1. Proper Format Selection
      2. Proper Sizing and provide dimension on page
      3. Compression
      4. Fewer Images
    2. Optimize CSS Code and DeliveryOptimization isn’t all about minifying file size. The following best practices ensure a speed-optimized CSS delivery:
      1. Shorthand Coding
      2. Remove Browser Specific CSS Hacks
      3. Minify CSS
      4. Code Positioning
      5. Prioritize above-the-fold content
      6. CSS Delivery Best Practices
          1. Use only one external CSS style sheet.
          2. Do not use @import call.
          3. Remove unused CSS.
          4. Do not use CSS in HTML such as H1 and DIV tags.
          5. Use Inline small CSS or remove most inline css.
          6. Minify all CSS
          7. Minification – JavaScript, CSS, HTML

        compression

        Minification of CSS, JavaScript and HTML share common benefits: reduced network latency, fewer HTML requests, enhanced compression, faster browser downloading and execution, ultimately boosting page speed and yielding higher scores on website speed measuring tools.

    3. Minimize HTTP Requests : Web  page’s load time is spent downloading the different pieces-parts of the page: images, stylesheets, scripts, Flash, etc. An HTTP request is made for each one of these elements, so the more on-page components, the longer it takes for the page to render.
    4. Enable compression : Compression reduces the bandwidth of your pages, thereby reducing HTTP response. Most web servers can compress files in Gzip format before sending them for download, either by calling a third-party module or using built-in routines.
      To enable compression: 

      1. Apache: Use mod_deflate
        Add few lines of code in your.htaccess file to accomplish this:
        #Begin gzip and deflate
        <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/css application/x-javascript text/plain text/xml image/x-icon
        </IfModule>
      2. IIS: Use Configure HTTP Compression
      3. Nginx: Use HttpGzipModule
    5. Enable leverage browser caching: With browser caching, we’re explicitly instructing browsers to hang onto particular files for a specified period of time. When the file is needed again, the browser is to pull from its local cache instead of requesting it from the server again. 
    6. Enable Expire Headers :
      The ExpiresByType directive is used to tell browsers which files to cache and how long to hang onto them
      <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresByType text/html M3600
      ExpiresByType text/css M3600
      ExpiresByType application/x-javascript M3600
      ExpiresByType image/bmp M3600
      ExpiresByType image/gif M3600
      ExpiresByType image/x-icon M3600
      ExpiresByType image/jpeg M3600
      </IfModule>
  • Off Page
    1. Use of CDN server : CDN is an extension of cache optimization designed to supercharge website performance aimed specifically at globally dispersed Web traffic. Following are some of popular CDN networks.
      1. Maxcdn
      2. Cloudflare
      3. Microsoft Azure CDN
      4. Amazon Cloudfront
      5. BootstrapCDN
      6. CDNetworks
    2. Use of Cache
      1. Use of caching & DB caching in PHP
        1. OpcacheOPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.To install Opcache please go through following link:http://php.net/manual/en/opcache.installation.php
        2. MemCacheMemcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.Please go through following link:http://memcached.org/
        3. phpFastCachephpFastCache is a high-performance, distributed object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. To know more how to use please use following link:http://www.phpfastcache.com/
    3. Use of proper hosting server : It is recommended to use proper hosting services to boost site speed. Dedicated hosting server is more preferable over shared hosting.

Reference links : 

Leave a Reply

Your email address will not be published. Required fields are marked *