SlideShare a Scribd company logo
alanseiden.com
Alan Seiden Consulting
Web performance first aid
Web Performance First AidAlan Seiden Consulting
Alan Seiden Consulting
PHP on IBM i Expertise
• Project leader, Zend/IBM Toolkit
• Contributor, Zend Framework DB2/i enhancements
• Developer, Best Web Solution, IBM/Common
• Authority, web performance on IBM i/iSeries
2
Web Performance First AidAlan Seiden Consulting
Contact information
Alan Seiden
alan@alanseiden.com
201-447-2437
alanseiden.com
twitter: @alanseiden
3
Web Performance First AidAlan Seiden Consulting
Agenda for fast user experience
• Fast user experience
‣ Beyond speed of PHP and server
• Performance big picture
• Tools that show issues visually
• Tips and configurations
4
Web Performance First AidAlan Seiden Consulting
Why I started to focus on web front end
• Clients called me in for performance help
• Assumed drag was on the server, PHP/DB2
• BUT many of the problems were in the front end
(HTML, JS, CSS)
• Today’s complex web and mobile applications
require attention to front-end performance
Let’s start with the basics
5
Web Performance First AidAlan Seiden Consulting
HTTP (web) flow
6
Web Performance First AidAlan Seiden Consulting
Request-response protocol
• Client (browser) requests a file; server responds
• One file at a time (at most 2–6 in parallel)
• Browser requests HTML file, then as it parses HTML,
finds other file names to request (images, css, js...)
7
Web Performance First AidAlan Seiden Consulting
Each request passes through several
layers
8
Web Performance First AidAlan Seiden Consulting
You might guess one top strategy
Reduce the number and size of HTTP requests
Each HTTP request travels
through several layers
A common-sense
performance strategy
suggests itself
9
Web Performance First AidAlan Seiden Consulting
Perceived speed
10
Web Performance First AidAlan Seiden Consulting
When users say app is slow
• Watch them using the application
• Is slow page response the major problem?
• Or does the application not match their workflow?
• Can you help users get their job done with fewer
clicks?
11
Web Performance First AidAlan Seiden Consulting
Tips for perceived speed
• Users want to feel successful in achieving their
tasks. You can:
‣ Provide feedback and status information
‣ Give users a fast path through common tasks
‣ Reduce users’ anxiety by clearly labeling page elements,
buttons, links, etc., using their own terminology
‣ Run slow tasks asynchronously so users can cancel if desired
• Old but interesting study: http://www.uie.com/
events/roadshow/articles/download_time/
‣ “...when people accomplish what they set out to do on a site,
they perceive that site to be fast.”
• Let users know that “something is happening”
‣ The spinning “waiting” graphic still works
12
Web Performance First AidAlan Seiden Consulting
Reduce HTTP
requests
13
Web Performance First AidAlan Seiden Consulting
HTTP requests are costly
• Each request makes a round trip to server
• Each HTTP request consumes bandwidth and CPU
• In-network tests do not measure end-user
performance outside the network
‣ Users could have unpredictable DSL or mobile connections
‣ Firewalls and proxy servers may sit between the web server and
end user
• I’ve seen convoluted network configurations
14
Web Performance First AidAlan Seiden Consulting
Can caching help?
• Browsers can cache most files
• Files won’t have to be downloaded again till server
has updated versions
• BUT browser must check for updates to each file
• Possible successful status codes:
‣ HTTP 200: Server delivered new, fresh version of file
‣ HTTP 304: Server said “not modified.” Use cached copy.
• Faster, but still requres that request to check the file’s timestamp
• More about blocking and caching on next slide
15
Web Performance First AidAlan Seiden Consulting
Requests cause “blocking” in browser
• Browsers typically limit themselves to 2–6 parallel
requests to a given server
• File requests stack up, blocked by prev. requests
•
• Above, even “304 not modified” files caused blocking
• Solution: reduce number of images or improve
caching via “Expires” headers
• http://httpd.apache.org/docs/2.0/mod/mod_expires.html
16
Web Performance First AidAlan Seiden Consulting
Example: “Expires” headers (caching)
• For aggressive caching, place these directives in
Apache config file
• Can specify file types
ExpiresActive On
# A2592000 means expire after a month in the client's cache
ExpiresByType text/css A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType text/html A2592000
ExpiresByType image/png A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
• Many options: http://httpd.apache.org/docs/2.0/mod/mod_expires.html
17
Web Performance First AidAlan Seiden Consulting
More ways to reduce “blocking”
• If many .js or .css files are used:
§ Combine them into fewer files
§ Move contents of smaller .js or .css files inline to your pages,
eliminating those external files
§ Page Speed tool will help you decide
18
Web Performance First AidAlan Seiden Consulting
Create a favicon for your site
• Browsers always look for a file called favicon.ico in
your document root
• Those little icons that appear in the browser
• Once found, will be “remembered” by browser
• If not found, will be requested every time
• How to create a favicon:
§ http://www.alanseiden.com/2007/05/25/brand-your-site-with-a-
favicon/
19
Web Performance First AidAlan Seiden Consulting
Keep connections
open
20
Web Performance First AidAlan Seiden Consulting
Keep HTTP connections alive
‣ Enable “KeepAlive” setting in Apache
‣ The TCP connection will stay open, waiting for you
‣ Good when downloading many images, css, js files
‣ You’ll reduce the number of three-way “handshakes” that
establish a connection
‣ Even more important with longer SSL handshakes
21
Web Performance First AidAlan Seiden Consulting
KeepAlive details
• Configurable by number of seconds, number of files
to be downloaded, before closing connection
• Recommended settings for average site
‣ KeepAlive On
‣ KeepAliveTimeout 15
• Details:
‣ http://httpd.apache.org/docs/2.0/mod/core.html#keepalive
• Don’t overdo it—you are locking out other users
from that HTTP job while it’s dedicated to you
22
Web Performance First AidAlan Seiden Consulting
Connecting takes time
• Clues that Keepalive is off
§ “Connection: close”, “Connecting”
• Example bottom right: 3.6 seconds
“Connecting” (longer than average but it really
happened)
23
Web Performance First AidAlan Seiden Consulting
What you see when Keep-alive is on
• Firebug’s “Net” tab shows “Connection: Keep-
Alive”, and, here, timeout=300 seconds (5 minutes)
• Zero seconds to connect
• Keep-alive is working!
24
Web Performance First AidAlan Seiden Consulting
Use compression
25
Web Performance First AidAlan Seiden Consulting
Compression reduces file size
• Called gzip or mod_deflate, the same for our
purposes
• Compresses, speeds up html, javascript, css,
favicons, anything text-based
26
Web Performance First AidAlan Seiden Consulting
Netflix improved with gzip/deflate
• Saw 13-25% performance improvement
• Cut outbound traffic in half
§ That saves money for a busy site such as Netflix
• Details:
§ http://www.slideshare.net/billwscott/improving-netflix-
performance-experience
• It really works!
27
Web Performance First AidAlan Seiden Consulting
My compression test
• http://your-server:10088/Samples/SQL_access/
DB2_SQL_example.php
• Before compression: 31.0kb; loaded in 250ms
• After compression: 4.4kb; loaded in 109ms.
• That’s 14% of the size and 50% of the time!
28
Web Performance First AidAlan Seiden Consulting
Details of deflate/gzip compression
• Apache directives (sample)
# Load IBM i's module that performs compression
LoadModule deflate_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
# Specify content types to compress
AddOutputFilterByType DEFLATE application/x-httpd-php application/
json text/css application/x-javascript application/javascript
text/html
• Tutorial on my blog:
§ http://www.alanseiden.com/2010/08/13/maximize-zend-server-
performance-with-apache-compression/
• Apache reference:
§ http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
29
Web Performance First AidAlan Seiden Consulting
Ajax: friend or foe?
30
Web Performance First AidAlan Seiden Consulting
AJAX=Asynchronous Javascript And XML
• AJAX updates parts of a page without reloading the
whole page
• Not always XML. These days, JSON too
• Requests and file sizes are generally small
• Meant to bring SPEED to the web
• Potential problems if overused
31
Web Performance First AidAlan Seiden Consulting
AJAX mistake #1
• Too much of a good thing
§ Requiring several AJAX requests to complete before the page
itself can load fully
§ Too many HTTP requests at once
§ I’ve seen a situation where 4 AJAX requests were embedded in
a page load
• The AJAX doesn’t even start till the page loads
• Causes “blocking” as the requests pile up, waiting for the previous
ones to complete
• Sessions may be shared by all AJAX calls, so locks can occur
§ Solution: when page first loads, embed AJAX content in the page
• Re-use logic on the server side when building page
• Subsequent updates can be done with AJAX
32
Web Performance First AidAlan Seiden Consulting
AJAX mistake #2
• Duplicate requests
§ Might go unnoticed with javascript library tools (Dojo, jQuery...)
§ Happens more than you would expect! Common, actually
33
Web Performance First AidAlan Seiden Consulting
AJAX mistake #3
• Dynamically generating static content (don’t do that)
• Especially JSON to feed dropdown widgets
• Solutions:
• Change to static files
• Cache URLs (e.g. with Zend Page Cache if using PHP, or Apache
caching) See example below, before and after caching
• (Apologies for blurring: protecting confidentiality)
34
Web Performance First AidAlan Seiden Consulting
Blocking
from JS/CSS
35
Web Performance First AidAlan Seiden Consulting
Javascript is expensive for speed
• Besides all the HTTP requests, JS must be parsed
and run by your browser
‣ Even worse for mobile. Uses battery, CPU. Blocks UI
• JS libraries (Dojo, jQuery) include dozens of JS
files that you may not need
‣ Take a look with the tools shown later in this presentation.
You may see 100+ JS files
‣ Customize your JS library build to make distribution more
compact
• CSS (style sheets) are another area to examine.
Cut down/consolidate if you can
36
Web Performance First AidAlan Seiden Consulting
More tips for JS/CSS
• “Minify” if you can
‣ Strip out spaces/comments for production code
• http://www.jsmini.com/
• http://www.csscompressor.com/
• Many other tools
‣ Saves bandwidth; browser parses JS/CSS more quickly
• Create a custom build of your JS library
‣ Tutorial to create custom build of jQuery
• http://www.packtpub.com/article/building-a-custom-version-of-
jquery
37
Web Performance First AidAlan Seiden Consulting
Live demos of
front-end tools
38
Web Performance First AidAlan Seiden Consulting
Front-end tools demystify the web
• Visualize HTTP requests
• Find ways to eliminate requests or shrink
responses
• Test more easily
• Capture “before and after” results
‣ For your own documentation
‣ For a report to management
39
Web Performance First AidAlan Seiden Consulting
Favorite front-end performance tools
• REDbot
‣ http://redbot.org
• Firebug
‣ https://addons.mozilla.org/firefox/addon/firebug/
‣ Even better with Page Speed add-on
• http://code.google.com/speed/page-speed/
• Page Speed Insights from Google
‣ https://developers.google.com/speed/pagespeed/insights
• Web Page Test
‣ http://webpagetest.org
40
Web Performance First AidAlan Seiden Consulting
Firebug
• Firebug
• https://addons.mozilla.org/firefox/addon/firebug/
• Along with Page Speed, empowers anyone for performance
41
Web Performance First AidAlan Seiden Consulting
Firebug “Net” tab example
42
Web Performance First AidAlan Seiden Consulting
Page Speed add-on
• Page Speed add-on to Firebug, from Google
§ http://code.google.com/speed/page-speed/
§ http://code.google.com/speed/page-speed/download.html
§ Analyzes your site, suggests performance techniques
43
Web Performance First AidAlan Seiden Consulting
REDbot shows HTTP headers, codes
• Visitors to alanseiden.com are redirected to www.alanseiden.com
• Although redirects can harm performance, this one (‘www’) helps search engines
44
Web Performance First AidAlan Seiden Consulting
Page Speed Insights by Google
45
https://developers.google.com/speed/pagespeed/insights
Web Performance First AidAlan Seiden Consulting
A tip from Page Speed Insights
46
A large headshot was scaled to a
small size. Better to use a smaller
photo.
Web Performance First AidAlan Seiden Consulting
Web Page Test (webpagetest.org)
47
Web Performance First AidAlan Seiden Consulting
Webpagetest “Video/filmstrip” view
48
Web Performance First AidAlan Seiden Consulting
Advanced Settings of webpagetest
49
Web Performance First AidAlan Seiden Consulting
Keep front-end
performance in
mind
50
Web Performance First AidAlan Seiden Consulting
Remember...
• To provide an speedy overall user experience, use front-end
performance techniques, such as to:
‣ Reduce or shrink file sizes when you can
‣ Use gzip/deflate
‣ Enable keepalive (in moderation)
‣ Avoid excessive redirects
‣ Use a favicon
‣ Keep an eye on AJAX performance
• Let Firebug, Web Page Test, and Page Speed Insights assist you
• Get help when you need it
• To keep learning, see “Resources” slide, coming right up
51
Web Performance First AidAlan Seiden Consulting
Resources
52
Web Performance First AidAlan Seiden Consulting
Resources for front-end performance
• “Avoid These 7 Web Performance Snags”
‣ Alan’s article from June 2013 (subscription to iProDeveloper required)
• http://iprodeveloper.com/web-amp-mobile-development/avoid-
these-7-web-performance-snags
• Performance Calendar (front-end performance articles)
‣ http://calendar.perfplanet.com/
• Meetup groups and conferences: live and remote
‣ http://web-performance.meetup.com/
‣ http://velocityconf.com/
• Steve Souders (formerly Yahoo!, now Google)
‣ http://stevesouders.com
‣ @souders
‣ Books: High Performance Web Sites, Even Faster Web Sites
53
Web Performance First AidAlan Seiden Consulting
Contact
Alan Seiden
Alan Seiden Consulting
Ho-Ho-Kus, NJ
alanseiden.com
54
alan@alanseiden.com ● 201-447-2437 ● twitter: @alanseiden
Ad

More Related Content

What's hot (20)

Create a welcoming development environment on IBM i
Create a welcoming development environment on IBM iCreate a welcoming development environment on IBM i
Create a welcoming development environment on IBM i
Alan Seiden
 
Getting started with PHP on IBM i
Getting started with PHP on IBM iGetting started with PHP on IBM i
Getting started with PHP on IBM i
Zend by Rogue Wave Software
 
Performance tuning with zend framework
Performance tuning with zend frameworkPerformance tuning with zend framework
Performance tuning with zend framework
Alan Seiden
 
Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i  Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i
Zend by Rogue Wave Software
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi
Shlomo Vanunu
 
PHP on IBM i Tutorial
PHP on IBM i TutorialPHP on IBM i Tutorial
PHP on IBM i Tutorial
ZendCon
 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel Tour
Rod Flohr
 
A Bit of REST
A Bit of RESTA Bit of REST
A Bit of REST
ColdFusionConference
 
Running open source PHP applications on you IBM i
Running open source PHP applications on you IBM iRunning open source PHP applications on you IBM i
Running open source PHP applications on you IBM i
Proximity Group
 
Keeping up with PHP
Keeping up with PHPKeeping up with PHP
Keeping up with PHP
Zend by Rogue Wave Software
 
Performance tuning PHP on IBMi
Performance tuning PHP on IBMiPerformance tuning PHP on IBMi
Performance tuning PHP on IBMi
Zend by Rogue Wave Software
 
IBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right wayIBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right way
LetsConnect
 
Best and worst practices deploying IBM Connections
Best and worst practices deploying IBM ConnectionsBest and worst practices deploying IBM Connections
Best and worst practices deploying IBM Connections
LetsConnect
 
IBM Connections Adminblast - Connect17 (DEV 1268)
IBM Connections Adminblast - Connect17 (DEV 1268)IBM Connections Adminblast - Connect17 (DEV 1268)
IBM Connections Adminblast - Connect17 (DEV 1268)
Nico Meisenzahl
 
Life in the Fast Lane: Full Speed XPages!, #dd13
Life in the Fast Lane: Full Speed XPages!, #dd13Life in the Fast Lane: Full Speed XPages!, #dd13
Life in the Fast Lane: Full Speed XPages!, #dd13
Dominopoint - Italian Lotus User Group
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM Connections
LetsConnect
 
Social Connections 12 - IBM Connections Adminblast
Social Connections 12 - IBM Connections AdminblastSocial Connections 12 - IBM Connections Adminblast
Social Connections 12 - IBM Connections Adminblast
Nico Meisenzahl
 
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
panagenda
 
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power HourIBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
Chris Miller
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
Nico Meisenzahl
 
Create a welcoming development environment on IBM i
Create a welcoming development environment on IBM iCreate a welcoming development environment on IBM i
Create a welcoming development environment on IBM i
Alan Seiden
 
Performance tuning with zend framework
Performance tuning with zend frameworkPerformance tuning with zend framework
Performance tuning with zend framework
Alan Seiden
 
Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i  Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i
Zend by Rogue Wave Software
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi
Shlomo Vanunu
 
PHP on IBM i Tutorial
PHP on IBM i TutorialPHP on IBM i Tutorial
PHP on IBM i Tutorial
ZendCon
 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel Tour
Rod Flohr
 
Running open source PHP applications on you IBM i
Running open source PHP applications on you IBM iRunning open source PHP applications on you IBM i
Running open source PHP applications on you IBM i
Proximity Group
 
IBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right wayIBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right way
LetsConnect
 
Best and worst practices deploying IBM Connections
Best and worst practices deploying IBM ConnectionsBest and worst practices deploying IBM Connections
Best and worst practices deploying IBM Connections
LetsConnect
 
IBM Connections Adminblast - Connect17 (DEV 1268)
IBM Connections Adminblast - Connect17 (DEV 1268)IBM Connections Adminblast - Connect17 (DEV 1268)
IBM Connections Adminblast - Connect17 (DEV 1268)
Nico Meisenzahl
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM Connections
LetsConnect
 
Social Connections 12 - IBM Connections Adminblast
Social Connections 12 - IBM Connections AdminblastSocial Connections 12 - IBM Connections Adminblast
Social Connections 12 - IBM Connections Adminblast
Nico Meisenzahl
 
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
panagenda
 
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power HourIBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
Chris Miller
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
Nico Meisenzahl
 

Similar to Web Performance First Aid (20)

Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster Website
Rayed Alrashed
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek edition
Chris Love
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today
Chris Love
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
Hugo Fonseca
 
High performance website
High performance websiteHigh performance website
High performance website
Chamnap Chhorn
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
Eugene Lazutkin
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
Otto Kekäläinen
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
John McCaffrey
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
Betclic Everest Group Tech Team
 
WebHosting Performance / WordPress - Pubcon Vegas - Hendison
WebHosting Performance / WordPress  - Pubcon Vegas - HendisonWebHosting Performance / WordPress  - Pubcon Vegas - Hendison
WebHosting Performance / WordPress - Pubcon Vegas - Hendison
Search Commander, Inc.
 
Breaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinBreaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites Win
Jonathan Hochman
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
Taylor Lovett
 
Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11
Jess Coburn
 
5 critical-optimizations.v2
5 critical-optimizations.v25 critical-optimizations.v2
5 critical-optimizations.v2
Blaze Software Inc.
 
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 PotsdamFrom Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
Andreas Grabner
 
Best practices-wordpress-enterprise
Best practices-wordpress-enterpriseBest practices-wordpress-enterprise
Best practices-wordpress-enterprise
Taylor Lovett
 
Page Performance
Page PerformancePage Performance
Page Performance
atorreno
 
Why your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix itWhy your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix it
Robert Flournoy
 
Why your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix itWhy your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix it
strommen
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
Taylor Lovett
 
Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster Website
Rayed Alrashed
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek edition
Chris Love
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today
Chris Love
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
Hugo Fonseca
 
High performance website
High performance websiteHigh performance website
High performance website
Chamnap Chhorn
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
Eugene Lazutkin
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
Otto Kekäläinen
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
John McCaffrey
 
WebHosting Performance / WordPress - Pubcon Vegas - Hendison
WebHosting Performance / WordPress  - Pubcon Vegas - HendisonWebHosting Performance / WordPress  - Pubcon Vegas - Hendison
WebHosting Performance / WordPress - Pubcon Vegas - Hendison
Search Commander, Inc.
 
Breaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinBreaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites Win
Jonathan Hochman
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
Taylor Lovett
 
Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11
Jess Coburn
 
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 PotsdamFrom Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
Andreas Grabner
 
Best practices-wordpress-enterprise
Best practices-wordpress-enterpriseBest practices-wordpress-enterprise
Best practices-wordpress-enterprise
Taylor Lovett
 
Page Performance
Page PerformancePage Performance
Page Performance
atorreno
 
Why your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix itWhy your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix it
Robert Flournoy
 
Why your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix itWhy your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix it
strommen
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
Taylor Lovett
 
Ad

Recently uploaded (20)

Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Ad

Web Performance First Aid

  • 2. Web Performance First AidAlan Seiden Consulting Alan Seiden Consulting PHP on IBM i Expertise • Project leader, Zend/IBM Toolkit • Contributor, Zend Framework DB2/i enhancements • Developer, Best Web Solution, IBM/Common • Authority, web performance on IBM i/iSeries 2
  • 3. Web Performance First AidAlan Seiden Consulting Contact information Alan Seiden [email protected] 201-447-2437 alanseiden.com twitter: @alanseiden 3
  • 4. Web Performance First AidAlan Seiden Consulting Agenda for fast user experience • Fast user experience ‣ Beyond speed of PHP and server • Performance big picture • Tools that show issues visually • Tips and configurations 4
  • 5. Web Performance First AidAlan Seiden Consulting Why I started to focus on web front end • Clients called me in for performance help • Assumed drag was on the server, PHP/DB2 • BUT many of the problems were in the front end (HTML, JS, CSS) • Today’s complex web and mobile applications require attention to front-end performance Let’s start with the basics 5
  • 6. Web Performance First AidAlan Seiden Consulting HTTP (web) flow 6
  • 7. Web Performance First AidAlan Seiden Consulting Request-response protocol • Client (browser) requests a file; server responds • One file at a time (at most 2–6 in parallel) • Browser requests HTML file, then as it parses HTML, finds other file names to request (images, css, js...) 7
  • 8. Web Performance First AidAlan Seiden Consulting Each request passes through several layers 8
  • 9. Web Performance First AidAlan Seiden Consulting You might guess one top strategy Reduce the number and size of HTTP requests Each HTTP request travels through several layers A common-sense performance strategy suggests itself 9
  • 10. Web Performance First AidAlan Seiden Consulting Perceived speed 10
  • 11. Web Performance First AidAlan Seiden Consulting When users say app is slow • Watch them using the application • Is slow page response the major problem? • Or does the application not match their workflow? • Can you help users get their job done with fewer clicks? 11
  • 12. Web Performance First AidAlan Seiden Consulting Tips for perceived speed • Users want to feel successful in achieving their tasks. You can: ‣ Provide feedback and status information ‣ Give users a fast path through common tasks ‣ Reduce users’ anxiety by clearly labeling page elements, buttons, links, etc., using their own terminology ‣ Run slow tasks asynchronously so users can cancel if desired • Old but interesting study: http://www.uie.com/ events/roadshow/articles/download_time/ ‣ “...when people accomplish what they set out to do on a site, they perceive that site to be fast.” • Let users know that “something is happening” ‣ The spinning “waiting” graphic still works 12
  • 13. Web Performance First AidAlan Seiden Consulting Reduce HTTP requests 13
  • 14. Web Performance First AidAlan Seiden Consulting HTTP requests are costly • Each request makes a round trip to server • Each HTTP request consumes bandwidth and CPU • In-network tests do not measure end-user performance outside the network ‣ Users could have unpredictable DSL or mobile connections ‣ Firewalls and proxy servers may sit between the web server and end user • I’ve seen convoluted network configurations 14
  • 15. Web Performance First AidAlan Seiden Consulting Can caching help? • Browsers can cache most files • Files won’t have to be downloaded again till server has updated versions • BUT browser must check for updates to each file • Possible successful status codes: ‣ HTTP 200: Server delivered new, fresh version of file ‣ HTTP 304: Server said “not modified.” Use cached copy. • Faster, but still requres that request to check the file’s timestamp • More about blocking and caching on next slide 15
  • 16. Web Performance First AidAlan Seiden Consulting Requests cause “blocking” in browser • Browsers typically limit themselves to 2–6 parallel requests to a given server • File requests stack up, blocked by prev. requests • • Above, even “304 not modified” files caused blocking • Solution: reduce number of images or improve caching via “Expires” headers • http://httpd.apache.org/docs/2.0/mod/mod_expires.html 16
  • 17. Web Performance First AidAlan Seiden Consulting Example: “Expires” headers (caching) • For aggressive caching, place these directives in Apache config file • Can specify file types ExpiresActive On # A2592000 means expire after a month in the client's cache ExpiresByType text/css A2592000 ExpiresByType application/x-javascript A2592000 ExpiresByType application/javascript A2592000 ExpiresByType text/html A2592000 ExpiresByType image/png A2592000 ExpiresByType image/gif A2592000 ExpiresByType image/jpeg A2592000 • Many options: http://httpd.apache.org/docs/2.0/mod/mod_expires.html 17
  • 18. Web Performance First AidAlan Seiden Consulting More ways to reduce “blocking” • If many .js or .css files are used: § Combine them into fewer files § Move contents of smaller .js or .css files inline to your pages, eliminating those external files § Page Speed tool will help you decide 18
  • 19. Web Performance First AidAlan Seiden Consulting Create a favicon for your site • Browsers always look for a file called favicon.ico in your document root • Those little icons that appear in the browser • Once found, will be “remembered” by browser • If not found, will be requested every time • How to create a favicon: § http://www.alanseiden.com/2007/05/25/brand-your-site-with-a- favicon/ 19
  • 20. Web Performance First AidAlan Seiden Consulting Keep connections open 20
  • 21. Web Performance First AidAlan Seiden Consulting Keep HTTP connections alive ‣ Enable “KeepAlive” setting in Apache ‣ The TCP connection will stay open, waiting for you ‣ Good when downloading many images, css, js files ‣ You’ll reduce the number of three-way “handshakes” that establish a connection ‣ Even more important with longer SSL handshakes 21
  • 22. Web Performance First AidAlan Seiden Consulting KeepAlive details • Configurable by number of seconds, number of files to be downloaded, before closing connection • Recommended settings for average site ‣ KeepAlive On ‣ KeepAliveTimeout 15 • Details: ‣ http://httpd.apache.org/docs/2.0/mod/core.html#keepalive • Don’t overdo it—you are locking out other users from that HTTP job while it’s dedicated to you 22
  • 23. Web Performance First AidAlan Seiden Consulting Connecting takes time • Clues that Keepalive is off § “Connection: close”, “Connecting” • Example bottom right: 3.6 seconds “Connecting” (longer than average but it really happened) 23
  • 24. Web Performance First AidAlan Seiden Consulting What you see when Keep-alive is on • Firebug’s “Net” tab shows “Connection: Keep- Alive”, and, here, timeout=300 seconds (5 minutes) • Zero seconds to connect • Keep-alive is working! 24
  • 25. Web Performance First AidAlan Seiden Consulting Use compression 25
  • 26. Web Performance First AidAlan Seiden Consulting Compression reduces file size • Called gzip or mod_deflate, the same for our purposes • Compresses, speeds up html, javascript, css, favicons, anything text-based 26
  • 27. Web Performance First AidAlan Seiden Consulting Netflix improved with gzip/deflate • Saw 13-25% performance improvement • Cut outbound traffic in half § That saves money for a busy site such as Netflix • Details: § http://www.slideshare.net/billwscott/improving-netflix- performance-experience • It really works! 27
  • 28. Web Performance First AidAlan Seiden Consulting My compression test • http://your-server:10088/Samples/SQL_access/ DB2_SQL_example.php • Before compression: 31.0kb; loaded in 250ms • After compression: 4.4kb; loaded in 109ms. • That’s 14% of the size and 50% of the time! 28
  • 29. Web Performance First AidAlan Seiden Consulting Details of deflate/gzip compression • Apache directives (sample) # Load IBM i's module that performs compression LoadModule deflate_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM # Specify content types to compress AddOutputFilterByType DEFLATE application/x-httpd-php application/ json text/css application/x-javascript application/javascript text/html • Tutorial on my blog: § http://www.alanseiden.com/2010/08/13/maximize-zend-server- performance-with-apache-compression/ • Apache reference: § http://httpd.apache.org/docs/2.0/mod/mod_deflate.html 29
  • 30. Web Performance First AidAlan Seiden Consulting Ajax: friend or foe? 30
  • 31. Web Performance First AidAlan Seiden Consulting AJAX=Asynchronous Javascript And XML • AJAX updates parts of a page without reloading the whole page • Not always XML. These days, JSON too • Requests and file sizes are generally small • Meant to bring SPEED to the web • Potential problems if overused 31
  • 32. Web Performance First AidAlan Seiden Consulting AJAX mistake #1 • Too much of a good thing § Requiring several AJAX requests to complete before the page itself can load fully § Too many HTTP requests at once § I’ve seen a situation where 4 AJAX requests were embedded in a page load • The AJAX doesn’t even start till the page loads • Causes “blocking” as the requests pile up, waiting for the previous ones to complete • Sessions may be shared by all AJAX calls, so locks can occur § Solution: when page first loads, embed AJAX content in the page • Re-use logic on the server side when building page • Subsequent updates can be done with AJAX 32
  • 33. Web Performance First AidAlan Seiden Consulting AJAX mistake #2 • Duplicate requests § Might go unnoticed with javascript library tools (Dojo, jQuery...) § Happens more than you would expect! Common, actually 33
  • 34. Web Performance First AidAlan Seiden Consulting AJAX mistake #3 • Dynamically generating static content (don’t do that) • Especially JSON to feed dropdown widgets • Solutions: • Change to static files • Cache URLs (e.g. with Zend Page Cache if using PHP, or Apache caching) See example below, before and after caching • (Apologies for blurring: protecting confidentiality) 34
  • 35. Web Performance First AidAlan Seiden Consulting Blocking from JS/CSS 35
  • 36. Web Performance First AidAlan Seiden Consulting Javascript is expensive for speed • Besides all the HTTP requests, JS must be parsed and run by your browser ‣ Even worse for mobile. Uses battery, CPU. Blocks UI • JS libraries (Dojo, jQuery) include dozens of JS files that you may not need ‣ Take a look with the tools shown later in this presentation. You may see 100+ JS files ‣ Customize your JS library build to make distribution more compact • CSS (style sheets) are another area to examine. Cut down/consolidate if you can 36
  • 37. Web Performance First AidAlan Seiden Consulting More tips for JS/CSS • “Minify” if you can ‣ Strip out spaces/comments for production code • http://www.jsmini.com/ • http://www.csscompressor.com/ • Many other tools ‣ Saves bandwidth; browser parses JS/CSS more quickly • Create a custom build of your JS library ‣ Tutorial to create custom build of jQuery • http://www.packtpub.com/article/building-a-custom-version-of- jquery 37
  • 38. Web Performance First AidAlan Seiden Consulting Live demos of front-end tools 38
  • 39. Web Performance First AidAlan Seiden Consulting Front-end tools demystify the web • Visualize HTTP requests • Find ways to eliminate requests or shrink responses • Test more easily • Capture “before and after” results ‣ For your own documentation ‣ For a report to management 39
  • 40. Web Performance First AidAlan Seiden Consulting Favorite front-end performance tools • REDbot ‣ http://redbot.org • Firebug ‣ https://addons.mozilla.org/firefox/addon/firebug/ ‣ Even better with Page Speed add-on • http://code.google.com/speed/page-speed/ • Page Speed Insights from Google ‣ https://developers.google.com/speed/pagespeed/insights • Web Page Test ‣ http://webpagetest.org 40
  • 41. Web Performance First AidAlan Seiden Consulting Firebug • Firebug • https://addons.mozilla.org/firefox/addon/firebug/ • Along with Page Speed, empowers anyone for performance 41
  • 42. Web Performance First AidAlan Seiden Consulting Firebug “Net” tab example 42
  • 43. Web Performance First AidAlan Seiden Consulting Page Speed add-on • Page Speed add-on to Firebug, from Google § http://code.google.com/speed/page-speed/ § http://code.google.com/speed/page-speed/download.html § Analyzes your site, suggests performance techniques 43
  • 44. Web Performance First AidAlan Seiden Consulting REDbot shows HTTP headers, codes • Visitors to alanseiden.com are redirected to www.alanseiden.com • Although redirects can harm performance, this one (‘www’) helps search engines 44
  • 45. Web Performance First AidAlan Seiden Consulting Page Speed Insights by Google 45 https://developers.google.com/speed/pagespeed/insights
  • 46. Web Performance First AidAlan Seiden Consulting A tip from Page Speed Insights 46 A large headshot was scaled to a small size. Better to use a smaller photo.
  • 47. Web Performance First AidAlan Seiden Consulting Web Page Test (webpagetest.org) 47
  • 48. Web Performance First AidAlan Seiden Consulting Webpagetest “Video/filmstrip” view 48
  • 49. Web Performance First AidAlan Seiden Consulting Advanced Settings of webpagetest 49
  • 50. Web Performance First AidAlan Seiden Consulting Keep front-end performance in mind 50
  • 51. Web Performance First AidAlan Seiden Consulting Remember... • To provide an speedy overall user experience, use front-end performance techniques, such as to: ‣ Reduce or shrink file sizes when you can ‣ Use gzip/deflate ‣ Enable keepalive (in moderation) ‣ Avoid excessive redirects ‣ Use a favicon ‣ Keep an eye on AJAX performance • Let Firebug, Web Page Test, and Page Speed Insights assist you • Get help when you need it • To keep learning, see “Resources” slide, coming right up 51
  • 52. Web Performance First AidAlan Seiden Consulting Resources 52
  • 53. Web Performance First AidAlan Seiden Consulting Resources for front-end performance • “Avoid These 7 Web Performance Snags” ‣ Alan’s article from June 2013 (subscription to iProDeveloper required) • http://iprodeveloper.com/web-amp-mobile-development/avoid- these-7-web-performance-snags • Performance Calendar (front-end performance articles) ‣ http://calendar.perfplanet.com/ • Meetup groups and conferences: live and remote ‣ http://web-performance.meetup.com/ ‣ http://velocityconf.com/ • Steve Souders (formerly Yahoo!, now Google) ‣ http://stevesouders.com ‣ @souders ‣ Books: High Performance Web Sites, Even Faster Web Sites 53
  • 54. Web Performance First AidAlan Seiden Consulting Contact Alan Seiden Alan Seiden Consulting Ho-Ho-Kus, NJ alanseiden.com 54 [email protected] ● 201-447-2437 ● twitter: @alanseiden