SlideShare a Scribd company logo
2
Most read
7
Most read
13
Most read
Web Site Optimization

Why ???

To know some basic rules/practices while
developing a web-application.

Whom ???

Web devlopers who are working html,css,js and
other web technology.

What ???

Its difficult to implement all the points that we
discuss today. But we can check something.
Web Site Optimization
In this session we'll go through 4 basic stuffs.

Basic optimization rules

Optimizing assets (images, scripts, and styles)

Optimizations specific to scripts

Optimizations specific to styles
Web Site Optimization

Decrease Download Sizes

Keep all the assets as lightweight as possible

Creating lean HTML code

Make Fewer HTTP Requests

Combine scripts and style sheets

Use image sprites

Avoid redirects

Avoid frames
Basic Optimization Rules
Web Site Optimization

Use a Content Delivery Network (CDN)

Host Assets on Different Domains but Reduce
DNS Lookups

Place Assets on a Cookie-free Domain

Split the Assets Among Domains

Use the Header Expiry/caching

Serve gzipped Content

Handling web images
Optimizing Assets
Web Site Optimization
Using a Content Delivery Network – CDN

CDN is a network of servers in different
geographical locations.

Each server has a copy of a site’s files. When a
visitor to your site requests a file, the file is
delivered from the nearest server

Its expensive :(
Optimizing Assets
Web Site Optimization
Why host assets on different domains ?????
Seems its an extra headache for me !!!!! :(

The biggest impact on end-user response times
is the number of components in the page.

Each component requires an extra HTTP
request.

Browser allows a limited number of component
for parallel downloading per host. (mostly only
2)
Optimizing Assets
Web Site Optimization
Lets see what if there is parallel download....
Lets assume we have 10 components along with
the page.
Optimizing Assets
Web Site Optimization
What if components are on different domains..
( Create subdomains and host assets )
Optimizing Assets
Web Site Optimization
Warning !!!!!!!!!!

Depending on your bandwidth and CPU speed,
too many parallel downloads can degrade
performance.

It takes about 20-120 milliseconds for DNS
(Domain Name System) to resolve IP address
for a given hostname or domain name and the
browser cannot do anything until the process is
properly completed.
Optimizing Assets
Web Site Optimization
Place Assets on a Cookie-free Domain

If you set a lot of cookies, the request headers
for your pages will increase in size, since those
cookies are sent with each request.

If you use subdomains to host your assets, you
need to make sure that the cookies you set are
for your canonical domain name (e.g.
www.example.org) and not for the top-level
domain name (e.g. example.org).
Optimizing Assets
Web Site Optimization
Customized Expiry header.....

By using a customized Expiry header, your web
components like images, static files, CSS,
Javascript skipped unnecessary HTTP request
when the same user reload the page for the
second time.

Setting the Expires header in Apache is easy:
Lets see the example on next slide
Optimizing Assets
Web Site Optimization
Example Expiry header.....
Add an .htaccess file that contains the following
directives to the root folder of your i1 and i2
subdomains
ExpiresActive On
ExpiresDefault "modification plus 10 years"
If you want, you can even set an expiration date per file
type:
ExpiresActive On
ExpiresByType application/x-javascript "modification plus 2 years"
ExpiresByType text/css "modification plus 5 years"
For more : http://httpd.apache.org/docs/2.0/mod/mod_expires.html
Optimizing Assets
Web Site Optimization
Handling Web Images...
Images are important part of your website.
However if they are not properly optimize, they
can become a burden and end up utilizing
unpredictably large amount of bandwidths on
daily basis.

Don’t Scale Images. Always practice inserting the
width and height for each images. Also don’t scale
down an image just because you need a smaller
version on the web. For example: Do not force scale a
200×200 px image to 50×50 px for your website by
altering the width and height. Get a 50×50 px instead.
Optimizing Assets
Web Site Optimization
Serve gzipped Content...

Apache 1.x and 2.x can automatically compress
files, but neither one comes with a compressor
enabled by default. Enabling compression
reduces CSS, HTML, and JavaScript file sizes
by 55-65% and speeds up overall page load
times by 35-40%.

Apache uses plug-in modules to add
functionality. For Apache 1.x, use the free
mod_gzip module to compress files. For
Apache 2.x, use mod_gzip or the built-in
mod_deflate module.
Optimizing Assets
Web Site Optimization
For gzipped Content...

The mod_gzip module can be used with Apache 1.x or 2.x,
but it doesn’t come with either Apache distribution. You’ll
need to download and install it separately.

Add the following lines to your server configuration file or
to a site’s “.htaccess” file:
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
Optimizing Assets
Web Site Optimization
For gzipped Content...

For IIS
http://www.smallworkarounds.net/2009/01/aspnet-iis-tricks-using-
gzip.html
http://jeeshenlee.com/2010/08/01/how-to-gzip-on-asp-net-and-godaddy/
Optimizing Assets
Web Site Optimization

Merge .js f iles

Minify scripts

For Minify http://compressor.ebiene.de/

http://javascriptcompressor.com/

Place scripts at the bottom of the page

Remove duplicates
Javascript Optimizations
Web Site Optimization
Merge script files ….

You should aim for your JavaScripts to make as
few requests as possible; ideally, this also
means that you should have only one .js file.
This task is as simple as taking all .js script files
and placing them into a single file.
Example : http://code.google.com/p/phpflair/
Javascript Optimizations
Web Site Optimization

Merge and Minify

For Minify http://compressor.ebiene.de/

http://www.cleancss.com/

Place styles at the top of the page

Ban Expressions

#content {

left: expression(document.body.offsetWidth)

}
CSS Optimizations
Web Site Optimization
#element-id{
background-image: url(image.png);
background-position: -8px -8px;
width: 16px;
height: 16px;
}
Web Site Optimization

Firebug’s Net panel for Firefox, at
http://www.getfirebug.com

YSlow, Yahoo!’s performance extension to
Firebug, at http://developer.yahoo.com/yslow/

LiveHTTP Headers for Firefox, at
http://livehttpheaders.mozdev.org/

Fiddler — for IE, but also a general-purpose
packet sniffer, at
http://www.fiddlertool.com/fiddler/

Web Inspector for Safari, at
http://webkit.org/blog/?p=41
TOOLS FOR PERFORMANCE OPTIMIZATION

More Related Content

PPT
On page seo
sathya ravi
 
PPTX
Seo presentation
travel_affair
 
PPTX
basic Seo ppt
jaswinder01
 
PPTX
ON PAGE SEO
hemapriya325330
 
PPTX
KEYWORD RESEARCH & SEO
AVIK BAL
 
PPTX
Website performance optimization
Shubham Shinde
 
PDF
Basics of Search Engine Optimisation
WordCamp Sydney
 
PPT
Basic SEO Presentation
Paul Kortman
 
On page seo
sathya ravi
 
Seo presentation
travel_affair
 
basic Seo ppt
jaswinder01
 
ON PAGE SEO
hemapriya325330
 
KEYWORD RESEARCH & SEO
AVIK BAL
 
Website performance optimization
Shubham Shinde
 
Basics of Search Engine Optimisation
WordCamp Sydney
 
Basic SEO Presentation
Paul Kortman
 

What's hot (20)

PPT
On page seo ppt
PRAJNAPARAMITAJENA6
 
PPTX
On-Page SEO
Ravi Bhadauria
 
PDF
Seo strategy guide 2019
Sanjay Patwal
 
PPTX
Seo goals & objectives 2 quarter 2012
EBY3081
 
PPTX
Schema Markup
SysComm international
 
PDF
SEO ppt.pdf
BaristaCook
 
PPTX
Web Performance: 3 Stages to Success
Austin Gil
 
PPT
Link building ppt
Chaitanya Raavi
 
PPTX
On Page SEO
Digital Marketing Tatva
 
PPT
Seo Marketing Plan Ppt
Jason_Chlebowski
 
PPT
What is SEO? - Basic SEO Guide for Beginners.pptx
Geromme Talampas
 
PPTX
SEO proposal
AakritiAggarwal13
 
PDF
Website Analysis Report
AuroIN
 
PDF
Content Writing Tips
Red Dot Geek
 
PPTX
Foxtail Website Audit
Foxtail Marketing
 
PPT
Seo ppt - BEGINNERS COURSE - COMPLETE GUIDE - ARISE ROBY
Arise Roby
 
PPT
Pay Per Click Advertising
Girish Aughade
 
PDF
Amazon DSP Strategy: How to Leverage DSP Capabilities to Capture Audience Demand
Tinuiti
 
On page seo ppt
PRAJNAPARAMITAJENA6
 
On-Page SEO
Ravi Bhadauria
 
Seo strategy guide 2019
Sanjay Patwal
 
Seo goals & objectives 2 quarter 2012
EBY3081
 
Schema Markup
SysComm international
 
SEO ppt.pdf
BaristaCook
 
Web Performance: 3 Stages to Success
Austin Gil
 
Link building ppt
Chaitanya Raavi
 
Seo Marketing Plan Ppt
Jason_Chlebowski
 
What is SEO? - Basic SEO Guide for Beginners.pptx
Geromme Talampas
 
SEO proposal
AakritiAggarwal13
 
Website Analysis Report
AuroIN
 
Content Writing Tips
Red Dot Geek
 
Foxtail Website Audit
Foxtail Marketing
 
Seo ppt - BEGINNERS COURSE - COMPLETE GUIDE - ARISE ROBY
Arise Roby
 
Pay Per Click Advertising
Girish Aughade
 
Amazon DSP Strategy: How to Leverage DSP Capabilities to Capture Audience Demand
Tinuiti
 
Ad

Viewers also liked (20)

PPT
Html5 History-API
Mindfire Solutions
 
PDF
EuroDjangoCon 2009 - Ein Rückblick
Markus Zapke-Gründemann
 
PPT
Load testing
Mindfire Solutions
 
PDF
Django - The Web framework for perfectionists with deadlines
Markus Zapke-Gründemann
 
PPT
Digesting jQuery
Mindfire Solutions
 
ODP
Rabbitmq & Postgresql
Lucio Grenzi
 
PDF
2007 - 应用系统脆弱性概论
Na Lee
 
PDF
The Django Book, Chapter 16: django.contrib
Tzu-ping Chung
 
PDF
PyClab.__init__(self)
Tzu-ping Chung
 
PDF
2 × 3 = 6
Tzu-ping Chung
 
PDF
Django e il Rap Elia Contini
WEBdeBS
 
PDF
라이트닝 토크 2015 파이콘
Jiho Lee
 
PDF
Django - The Web framework for perfectionists with deadlines
Markus Zapke-Gründemann
 
PDF
Bottle - Python Web Microframework
Markus Zapke-Gründemann
 
PDF
NoSql Day - Apertura
WEBdeBS
 
PDF
Django mongodb -djangoday_
WEBdeBS
 
PDF
Vim for Mere Mortals
Clayton Parker
 
PPT
Django-Queryset
Mindfire Solutions
 
PPTX
2016 py con2016_lightingtalk_php to python
Jiho Lee
 
PDF
User-centered open source
Jacqueline Kazil
 
Html5 History-API
Mindfire Solutions
 
EuroDjangoCon 2009 - Ein Rückblick
Markus Zapke-Gründemann
 
Load testing
Mindfire Solutions
 
Django - The Web framework for perfectionists with deadlines
Markus Zapke-Gründemann
 
Digesting jQuery
Mindfire Solutions
 
Rabbitmq & Postgresql
Lucio Grenzi
 
2007 - 应用系统脆弱性概论
Na Lee
 
The Django Book, Chapter 16: django.contrib
Tzu-ping Chung
 
PyClab.__init__(self)
Tzu-ping Chung
 
2 × 3 = 6
Tzu-ping Chung
 
Django e il Rap Elia Contini
WEBdeBS
 
라이트닝 토크 2015 파이콘
Jiho Lee
 
Django - The Web framework for perfectionists with deadlines
Markus Zapke-Gründemann
 
Bottle - Python Web Microframework
Markus Zapke-Gründemann
 
NoSql Day - Apertura
WEBdeBS
 
Django mongodb -djangoday_
WEBdeBS
 
Vim for Mere Mortals
Clayton Parker
 
Django-Queryset
Mindfire Solutions
 
2016 py con2016_lightingtalk_php to python
Jiho Lee
 
User-centered open source
Jacqueline Kazil
 
Ad

Similar to Website optimization (20)

PPTX
Web site loading time optimization
Damith Kothalawala
 
PPTX
The Need for Speed - SMX Sydney 2013
Bastian Grimm
 
PPTX
Performace optimization (increase website speed)
clickramanm
 
PPTX
Optimizing Client-Side Performance
andrew4web
 
PPT
Heavy Web Optimization: Frontend
Võ Duy Tuấn
 
PDF
Optimization
Petros Antoniou
 
PDF
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
Bastian Grimm
 
PDF
High Performance Websites
Aaron Grogg
 
PDF
A little journey into website optimization
Stelian Firez
 
PPTX
Website Performance
Hugo Fonseca
 
PPT
Web performance Talk
Prasoon Agrawal
 
PDF
High performance website
Chamnap Chhorn
 
PPTX
Breaking the Speed Limit: Faster Websites Win
Jonathan Hochman
 
PPTX
Tom Bennet – BrightonSEO April 2016: Site Speed for content Marketers
Authoritas
 
PPT
performance.ppt
fakeaccount225095
 
PPTX
Analysis of Google Page Speed Insight
Sarvesh Sonawane
 
PPTX
Improving web site performance and scalability while saving
mdc11
 
PPT
Frontend performance
sacred 8
 
PDF
Website speed optimization techniques 2017!
austinbaileyg
 
PDF
Performance tuning of Websites
muHive Technologies
 
Web site loading time optimization
Damith Kothalawala
 
The Need for Speed - SMX Sydney 2013
Bastian Grimm
 
Performace optimization (increase website speed)
clickramanm
 
Optimizing Client-Side Performance
andrew4web
 
Heavy Web Optimization: Frontend
Võ Duy Tuấn
 
Optimization
Petros Antoniou
 
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
Bastian Grimm
 
High Performance Websites
Aaron Grogg
 
A little journey into website optimization
Stelian Firez
 
Website Performance
Hugo Fonseca
 
Web performance Talk
Prasoon Agrawal
 
High performance website
Chamnap Chhorn
 
Breaking the Speed Limit: Faster Websites Win
Jonathan Hochman
 
Tom Bennet – BrightonSEO April 2016: Site Speed for content Marketers
Authoritas
 
performance.ppt
fakeaccount225095
 
Analysis of Google Page Speed Insight
Sarvesh Sonawane
 
Improving web site performance and scalability while saving
mdc11
 
Frontend performance
sacred 8
 
Website speed optimization techniques 2017!
austinbaileyg
 
Performance tuning of Websites
muHive Technologies
 

More from Mindfire Solutions (20)

PDF
Physician Search and Review
Mindfire Solutions
 
PDF
diet management app
Mindfire Solutions
 
PDF
Business Technology Solution
Mindfire Solutions
 
PDF
Remote Health Monitoring
Mindfire Solutions
 
PDF
Influencer Marketing Solution
Mindfire Solutions
 
PPT
High Availability of Azure Applications
Mindfire Solutions
 
PPTX
IOT Hands On
Mindfire Solutions
 
PPTX
Glimpse of Loops Vs Set
Mindfire Solutions
 
ODP
Oracle Sql Developer-Getting Started
Mindfire Solutions
 
PPT
Adaptive Layout In iOS 8
Mindfire Solutions
 
PPT
Introduction to Auto-layout : iOS/Mac
Mindfire Solutions
 
PPT
LINQPad - utility Tool
Mindfire Solutions
 
PPT
Get started with watch kit development
Mindfire Solutions
 
PPTX
Swift vs Objective-C
Mindfire Solutions
 
ODP
Material Design in Android
Mindfire Solutions
 
ODP
Introduction to OData
Mindfire Solutions
 
PPT
Ext js Part 2- MVC
Mindfire Solutions
 
PPT
ExtJs Basic Part-1
Mindfire Solutions
 
PPT
Spring Security Introduction
Mindfire Solutions
 
Physician Search and Review
Mindfire Solutions
 
diet management app
Mindfire Solutions
 
Business Technology Solution
Mindfire Solutions
 
Remote Health Monitoring
Mindfire Solutions
 
Influencer Marketing Solution
Mindfire Solutions
 
High Availability of Azure Applications
Mindfire Solutions
 
IOT Hands On
Mindfire Solutions
 
Glimpse of Loops Vs Set
Mindfire Solutions
 
Oracle Sql Developer-Getting Started
Mindfire Solutions
 
Adaptive Layout In iOS 8
Mindfire Solutions
 
Introduction to Auto-layout : iOS/Mac
Mindfire Solutions
 
LINQPad - utility Tool
Mindfire Solutions
 
Get started with watch kit development
Mindfire Solutions
 
Swift vs Objective-C
Mindfire Solutions
 
Material Design in Android
Mindfire Solutions
 
Introduction to OData
Mindfire Solutions
 
Ext js Part 2- MVC
Mindfire Solutions
 
ExtJs Basic Part-1
Mindfire Solutions
 
Spring Security Introduction
Mindfire Solutions
 

Recently uploaded (20)

PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Doc9.....................................
SofiaCollazos
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
The Future of Artificial Intelligence (AI)
Mukul
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Doc9.....................................
SofiaCollazos
 

Website optimization

  • 1. Web Site Optimization  Why ???  To know some basic rules/practices while developing a web-application.  Whom ???  Web devlopers who are working html,css,js and other web technology.  What ???  Its difficult to implement all the points that we discuss today. But we can check something.
  • 2. Web Site Optimization In this session we'll go through 4 basic stuffs.  Basic optimization rules  Optimizing assets (images, scripts, and styles)  Optimizations specific to scripts  Optimizations specific to styles
  • 3. Web Site Optimization  Decrease Download Sizes  Keep all the assets as lightweight as possible  Creating lean HTML code  Make Fewer HTTP Requests  Combine scripts and style sheets  Use image sprites  Avoid redirects  Avoid frames Basic Optimization Rules
  • 4. Web Site Optimization  Use a Content Delivery Network (CDN)  Host Assets on Different Domains but Reduce DNS Lookups  Place Assets on a Cookie-free Domain  Split the Assets Among Domains  Use the Header Expiry/caching  Serve gzipped Content  Handling web images Optimizing Assets
  • 5. Web Site Optimization Using a Content Delivery Network – CDN  CDN is a network of servers in different geographical locations.  Each server has a copy of a site’s files. When a visitor to your site requests a file, the file is delivered from the nearest server  Its expensive :( Optimizing Assets
  • 6. Web Site Optimization Why host assets on different domains ????? Seems its an extra headache for me !!!!! :(  The biggest impact on end-user response times is the number of components in the page.  Each component requires an extra HTTP request.  Browser allows a limited number of component for parallel downloading per host. (mostly only 2) Optimizing Assets
  • 7. Web Site Optimization Lets see what if there is parallel download.... Lets assume we have 10 components along with the page. Optimizing Assets
  • 8. Web Site Optimization What if components are on different domains.. ( Create subdomains and host assets ) Optimizing Assets
  • 9. Web Site Optimization Warning !!!!!!!!!!  Depending on your bandwidth and CPU speed, too many parallel downloads can degrade performance.  It takes about 20-120 milliseconds for DNS (Domain Name System) to resolve IP address for a given hostname or domain name and the browser cannot do anything until the process is properly completed. Optimizing Assets
  • 10. Web Site Optimization Place Assets on a Cookie-free Domain  If you set a lot of cookies, the request headers for your pages will increase in size, since those cookies are sent with each request.  If you use subdomains to host your assets, you need to make sure that the cookies you set are for your canonical domain name (e.g. www.example.org) and not for the top-level domain name (e.g. example.org). Optimizing Assets
  • 11. Web Site Optimization Customized Expiry header.....  By using a customized Expiry header, your web components like images, static files, CSS, Javascript skipped unnecessary HTTP request when the same user reload the page for the second time.  Setting the Expires header in Apache is easy: Lets see the example on next slide Optimizing Assets
  • 12. Web Site Optimization Example Expiry header..... Add an .htaccess file that contains the following directives to the root folder of your i1 and i2 subdomains ExpiresActive On ExpiresDefault "modification plus 10 years" If you want, you can even set an expiration date per file type: ExpiresActive On ExpiresByType application/x-javascript "modification plus 2 years" ExpiresByType text/css "modification plus 5 years" For more : http://httpd.apache.org/docs/2.0/mod/mod_expires.html Optimizing Assets
  • 13. Web Site Optimization Handling Web Images... Images are important part of your website. However if they are not properly optimize, they can become a burden and end up utilizing unpredictably large amount of bandwidths on daily basis.  Don’t Scale Images. Always practice inserting the width and height for each images. Also don’t scale down an image just because you need a smaller version on the web. For example: Do not force scale a 200×200 px image to 50×50 px for your website by altering the width and height. Get a 50×50 px instead. Optimizing Assets
  • 14. Web Site Optimization Serve gzipped Content...  Apache 1.x and 2.x can automatically compress files, but neither one comes with a compressor enabled by default. Enabling compression reduces CSS, HTML, and JavaScript file sizes by 55-65% and speeds up overall page load times by 35-40%.  Apache uses plug-in modules to add functionality. For Apache 1.x, use the free mod_gzip module to compress files. For Apache 2.x, use mod_gzip or the built-in mod_deflate module. Optimizing Assets
  • 15. Web Site Optimization For gzipped Content...  The mod_gzip module can be used with Apache 1.x or 2.x, but it doesn’t come with either Apache distribution. You’ll need to download and install it separately.  Add the following lines to your server configuration file or to a site’s “.htaccess” file: <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </IfModule> Optimizing Assets
  • 16. Web Site Optimization For gzipped Content...  For IIS http://www.smallworkarounds.net/2009/01/aspnet-iis-tricks-using- gzip.html http://jeeshenlee.com/2010/08/01/how-to-gzip-on-asp-net-and-godaddy/ Optimizing Assets
  • 17. Web Site Optimization  Merge .js f iles  Minify scripts  For Minify http://compressor.ebiene.de/  http://javascriptcompressor.com/  Place scripts at the bottom of the page  Remove duplicates Javascript Optimizations
  • 18. Web Site Optimization Merge script files ….  You should aim for your JavaScripts to make as few requests as possible; ideally, this also means that you should have only one .js file. This task is as simple as taking all .js script files and placing them into a single file. Example : http://code.google.com/p/phpflair/ Javascript Optimizations
  • 19. Web Site Optimization  Merge and Minify  For Minify http://compressor.ebiene.de/  http://www.cleancss.com/  Place styles at the top of the page  Ban Expressions  #content {  left: expression(document.body.offsetWidth)  } CSS Optimizations
  • 20. Web Site Optimization #element-id{ background-image: url(image.png); background-position: -8px -8px; width: 16px; height: 16px; }
  • 21. Web Site Optimization  Firebug’s Net panel for Firefox, at http://www.getfirebug.com  YSlow, Yahoo!’s performance extension to Firebug, at http://developer.yahoo.com/yslow/  LiveHTTP Headers for Firefox, at http://livehttpheaders.mozdev.org/  Fiddler — for IE, but also a general-purpose packet sniffer, at http://www.fiddlertool.com/fiddler/  Web Inspector for Safari, at http://webkit.org/blog/?p=41 TOOLS FOR PERFORMANCE OPTIMIZATION