Speed Up Your Website

Written by Allen White on. Posted in General, Web

Google has recently , in webmaster tools released an addon for firefox so that you can check the speed of your website pages when they load. The reason they have done this is that Google now counts page loading speed as part of the overall page “quality”. So if we can achieve higher page loading speeds then we achieve a higher page quality so when out pages are indexed hopefully they will rank even higher in the serps (Search Engine Results Pages ).

 

So, in this article I will go through a few steps you can take to speed up a few different types of sites. First of all you need firefox, the firebug plug in and the google plugin for page speed the plugin is located under “labs”. Once done it will look like this..

 

firefox page speed

firefox page speed

 

Basic Rules

Optimize Images: always use the “Save for the web” feature included on image editing software. Images represent the heavier load on virtually any website so make sure you are optimizing them. Alternatively you can also turn to an online image optimizer. Make sure that you use web friendly files suzj as GIF or JOG, dont use BMP and any other low compression formats. Dont put gadgets on your pages simply becasue you can, only pur gadgets and content on that users will need.

Apache Based Websites

On site that are on apache based servers you have a file called HTACCESS in the root of your access. Apache server support compression of HTML, CSS and a whole load of other files.

By simply enableing compression in out HTACCESS file the we can dramatically shrink our webpages before they are sent to the browsers, browser read these compressed files quicker so the page is loaded quicker..simple!.

Speed up website

Speed up website

So below you will see a what we will add to the HTACCESS file. Simply copy and paste it into the file.

 

<IfModule mod_deflate.c>
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico)$ no-gzip
</IfModule> 

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)\.(\d+)(_m_\d+)?\.([^\.]+)$ $1.$4 [L,QSA]
</IfModule> 

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
</IfModule> 

With that code we are telling the website to compress the page beofre sending it. You will also notice that we are telling the browser to cache the page incase the visitor comes again, again speeding up the page loading times.

 

WordPress Sites

WordPress is brilliant, no other word for it, this site is based on the wordpress platform. It enables you to add pluggins that do the job of adding code into your pages that normally would need hard coding. This site uses a plugin to compress pages, tell the browsers to cache pages for a dayand a ton of other options. The plugin is W3 Total Cache by W3 EDGE.

In your wordpress console go to to plugins and add new plug, search for W3 Total Cache. Then simply install it.

add plugin

add plugin

Once install you will see the performace tab in your console, it has a full user guide but the default settings once you click the deploy button are enough for 99% of wordpress sites.

Performance TAB

Performance TAB

 

Speed up MediaWiki Sites

Mediawiki is the platform that Wikipedia is sat upon, an amazing peice of software. I run a little hobby site of mine called Sunderland Wiki. This is based on the media wiki software. Out of the box the software does not compress files or cache files. Add the code below to your “localsettings.php” to enable caching etc. Make sure where it says “some directory” that you enter the directory that you want to store the cache in, in my case its crazily “cache” as you will see in the below image.

 

## Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMessageCacheType = CACHE_ACCEL;
$wgCacheDirectory = 'cache';
$wgParserCacheType = CACHE_ACCEL;
$wgMemCachedServers = array();
$wgUseGzip = true;
$wgEnableSidebarCache = true;
# NO DB HITS!
$wgDisableCounters = true;
$wgMiserMode = true;
# Text cache
$wgCompressRevisions = true;
$wgRevisionCacheExpiry = 3*24*3600;
$wgParserCacheExpireTime = 14*24*3600;
 
speed up wiki

speed up wiki

 

With the steps outlined above Techieshelp.com went from a page speed rating of 76 to 83 and sunderland wiki went from 72 to 81. According to google the average page speed is 81.

 

As usual, any comments or additions to the article will be great, if I can help then let me know.

 

 
 

Related Problems

How to redirect a web page
If you need to redirect your webpages to another page on your site then use this easy guide. How to redirect a webpage using a 301 redirect.
READ SOLUTION
How to Speed Up your iPhone
iPhone hints and tips. Speed up your IPhone.Some great tips and tricks on how to speed up your iphone if you find that is is running slow and lagging doing ...
READ SOLUTION
Windows 7 View Hidden Files
If you have files or folders that are hidden in windows 7, then you need to change a few settings to be able to view them. Here is how to ...
READ SOLUTION
HP Logo
How to expand an array with HP Array Configuration Utility. A guide on how to exapnd your server array.
READ SOLUTION
How to open a port in Trend IWSS
All ports by default are blocked in trend IWSS you need to specify in the console what ports are to be opened to allow traffic through. Here is a step ...
READ SOLUTION
Allow Pop3 Through Trend IWSS
Step by step guife on allowing pop3 email through trend IWSS software.Guide on how to open pop3 email ports in trend officescan
READ SOLUTION
Change File Association Windows 7
Change file assocation in windows 7 - a guide on how to change what program opens a file. How to set what opens files
READ SOLUTION
How to Delete multiple Pictures on the iPhone an iPad
A guide on how to delete multiple photos or video from the iphone and iPad. Delete items on your iPad or iPhone in bulk
READ SOLUTION
How to redirect a web page
How to Speed Up your iPhone
Windows 7 View Hidden Files
Expand an Array With HP ACU
How to open a port in Trend IWSS
Allow Pop3 Through Trend IWSS
Change File Association Windows 7
How to Delete multiple Pictures on the iPhone

Tags:

Allen White

Allen is a Technical Consultant for an IT company in the North East of England and holds the following accreditations. MCSA, MCSE, MCTS, MCITP, CCA, CCSP, VCP 4,5 and HP ASE, AIS - Network Infrastructure. Backup Academy Certified. I run this site in my spare time so if I help you then PLEASE take the time to share using the share tools on the site.

Comments (11)

  • PeteLong

    |

    This is the best article I’ve seen on this subject, I’ve used it myself today.

    Pete
    PeteNetLive

    Reply

    • admin

      |

      Thanks for this , I can confirm this site is great, just test my sites and it gives a good report :)

      Allen

      Reply

  • Gryzor

    |

    Unfortunately with the Mediawiki tip my wiki doesn’t load… I noticed the Diff lines, but I’m running my site on a Unix server with no shell access, so how do I go about fixing it?

    Even with those two lines commented out, though, it still doesn’t load.

    Reply

    • admin

      |

      Hi Gryzor, I had an issue with these lines when i first implemented

      # NO DB HITS!
      $wgDisableCounters = true;
      $wgMiserMode = true;

      If you comment them out with a # before the $`s then refresh do you have any luck.

      Also, any error codes would be great! :)

      Thisis the exact code ive just took from my wiki.

      # things to speed up site.
      ## Shared memory settings
      $wgMainCacheType = CACHE_ACCEL;
      $wgMessageCacheType = CACHE_ACCEL;
      $wgCacheDirectory = ‘cache';
      $wgParserCacheType = CACHE_ACCEL;
      $wgMemCachedServers = array();
      $wgUseGzip = true;
      $wgEnableSidebarCache = true;
      # NO DB HITS!
      $wgDisableCounters = true;

      # Text cache
      $wgCompressRevisions = true;
      $wgRevisionCacheExpiry = 3*24*3600;
      $wgParserCacheExpireTime = 14*24*3600;

      Reply

      • Gryzor

        |

        Ahhh it worked now… however my score remains the same – 74.

        A couple of notes: in your snippet the apostrophes of ‘cache’ are the wrong ones. Also, I think that disabling hit counters is not a good options for anything other than the smaller wikis…

        Thanks again for your help!

        Reply

        • admin

          |

          No problems, let your cache build up and test again on multiple pages.. Il note the hit counter comment and test again :)

          Thanks

          Allen.

          Reply

  • admin

    |

    Gryzor, i can see your page not loading, I think your server does not support GZIP.

    Remove tis line…

    $wgUseGzip = true;

    also the error your getting is..

    Notice: Use of undefined constant �cache� – assumed ‘�cache�’ in /srv/www/vhosts/cpcwiki.eu/httpdocs/LocalSettings.php on line 217 Warning: mkdir(): Permission denied in /srv/www/vhosts/cpcwiki.eu/httpdocs/includes/GlobalFunctions.php on line 2176 Warning: wfMkdirParents: failed to mkdir “�cache�” mode 511 in /srv/www/vhosts/cpcwiki.eu/httpdocs/includes/GlobalFunctions.php on line 2179

    Can you confirm you have created a cache flder with write permissions

    Reply

    • Gryzor

      |

      How did you see that gzip is not working? I’m actually aware of some possible malfunction (Google spped test reports that js and css is not gzipped, but txt is indeed) and am awaiting for a reply from the host.

      However the screwup was from the apostrophes around cache – it’s working now :)

      Reply

      • admin

        |

        I was browsing youre site and you must of refreshed it, A message came up saying that the mode of compression is not supported on this server :). Hope you get tis fixed :)

        Reply

What Do You Think?

Search Solutions

Categories

(c) Techieshelp.com. Please be aware, all information is provided freely, any information used is done so at your risk and Techieshelp will not be held responsible for any issue that may occur.