Optimising MOSS 2007 for the Internet Perth SharePoint User Group June 2008 Sezai Komur Senior...

Post on 28-Mar-2015

215 views 2 download

Transcript of Optimising MOSS 2007 for the Internet Perth SharePoint User Group June 2008 Sezai Komur Senior...

Optimising MOSS 2007 for the Internet

Perth SharePoint User Group

June 2008

Sezai Komur

Senior Developer Vivid Group

Developing Websites for the Internet• Different to developing Intranets!• Performance – page weight and page load time is important.

• Nobody likes a slow website – even if it’s “cool”.

How do you make an ASP.NET Website Faster?

• Reduce Page Weight Reduce the time it takes to download and a page.

• Optimise what is in the page – don’t download unnecessary files.

• Reduce the time it takes for a server to process and serve up a page and its resources.

Analysing Page Weight and Load Times

• Pingdom Tools – Full Page Test–http://tools.pingdom.com/fpt/

• Firebug add-on for Firefox has a Net Analysis tool

MOSS 2007 Website ExamplesWebsite Page Size Load Time

(ADSL2+)http://www.amanaliving.com.au 326 kb 4.96s

http://www.nntt.gov.au 494 kb 10.3s

http://www.microsoft.com 510 kb 9.88s

http://www.sharepointusers.org.au/Perth 663 kb 3.16s

http://www.microsoftsharepoint.com 772 kb 3.1s

http://www.nhs.uk 866 kb 20.9s

http://www.kpmg.com 943 kb 1.43s

http://sharepoint.microsoft.com/pedia 1.05 mb 15.91 s

http://www.tafe.wa.edu.au 1.06 mb 33.36s

http://www.ggs.wa.edu.au 1.09 mb 3.4s

http://www.premier.wa.gov.au 1.17 mb 11.58s

http://www.thatsmelbourne.com.au 1.19 mb 7.77s

http://www.hedkandi.com 1.63 mb 12.6s

Regular Examples

Website Page Size

Load Time (ADSL2+)

http://www.google.com.au/ 19 kb 0.672 s

http://www.australia.gov.au/ 120 kb 3.77 s

http://sharepoint-sezai-moss-2007.blogspot.com/

146 kb 3.89 s

http://www.vividgroup.com.au/ 204 kb 2.18 s

http://www.centrelink.gov.au/ 207 kb 2.5 s

http://www.youtube.com/ 209 kb 8.2 s

http://www.microsoft.com/en/au/default.aspx

210 kb 5.86 s

http://www.thewest.com.au/ 1.1 mb 9.6 s

http://www.news.com.au/perthnow/ 1.15 mb 15.06 s

Master Page Overview

• Contains Top Navigation, Search Box, Header, Footer – Common page elements

• Also contains the HTML head as well as Body tag• HTML head contains SharePoint Controls that link to SharePoint JavaScript (core.js), CSS and other Resources.

• Anonymous Internet users DO NOT require these files so it’s a waste of their bandwidth to download. Authenticated users editing content DO still need these files.

Developing a custom Master

• Minimal.Master – a clean canvas• Implement a custom HTML/CSS/JS design

• Custom CSS• Custom navigation controls

What is Form Mode?• Other CMS provide content editing in a “back-end” application.

• MOSS 2007 provides editing in context–“Switch to edit mode” on a page you are viewing.–Excellent authoring experience–Complex development experience

• By detecting Form mode you can target code and rendering to Edit Mode or Display Mode.–SPContext.Current.FormContext.FormMode–Microsoft.SharePoint.WebControls.SPControlMode Enumeration

• EditModePanel uses this.

Demo!

• Minimal.Master• Nothing.Master• Form Mode• Anonymous User Optimisation• Top Navigation Optimisation

Page Layout Overview

• Page Layouts are based on content types

• Field Controls on Page Layouts bind to Site Columns / Fields of the Page Layout Content Type

• Custom ASP.NET Server Controls or User Controls–Data from Site Lists–Data from Anywhere

• Web Parts

Optimising Custom Page Layouts• What is the page doing? How many controls/web parts on the page and what custom code is being run?

• What DATA is being retrieved by the custom code? Where? How?

• Optimise your server code and implement caching

• Memory Leaks! Exceptions! Dodgy Code!!!

Caching

• Implement ASP.NET level caching in custom code.

• Cache Navigation menus / SiteMapProvider

• Enable Blob cache and output cache–Files live in the Database –So caches files on the web server to reduce Database access

More Caching

• Store “Chrome” files directly on the file system of the web server – “Always Cached”–Can only be modified/updated by a developer

• IIS Static Compression–Core.js is 265kb, some sites have it at only 55kb due to IIS static compression

Rendering Tricks

• ASP.NET AJAX–Reduces the need to download an entire page resulting in FAST load times and an excellent user experience.

• BlendTrans Metatags - Fajax–Simple to implement –great result.

• White space removal to reduce page size and increase browser rendering speed.

Demo

• BlueBandBlendTrans.Master• Cache settings• Storing files

/_layouts/images and /_layouts/incVs/Style Library

The End