SlideShare a Scribd company logo
Optimising Web
application frontend
  Tomáš Kramár, @tkramar
What happens when I type address
         into browser?
GET /index.html

          GET /index.html
Browser




                            Server
GET /index.html

             index.html



          GET /assets/favicon.ico

             favicon.ico
Browser




                                    Server

Recommended for you

Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance

This document discusses tuning web performance from a frontend perspective. It covers the impact of performance on user experience, development tools for optimization like Firebug and Chrome DevTools, and various techniques for website optimization including reducing requests, optimizing images, leveraging caching, minimizing JavaScript, and improving loading efficiency. The goal is to provide an overview of concepts and tools for optimizing frontend performance.

javascriptwebfrontend
Care and feeding notes
Care and feeding notesCare and feeding notes
Care and feeding notes

This document discusses how to maintain large web applications over time. It describes how the author's team managed a web application with over 65,000 lines of code and 6,000 automated tests over 2.5 years of development. Key aspects included packaging full releases, automating dependency installation, specifying supported environments, and automating data migrations during upgrades. The goal was to have a sustainable process that allowed for continuous development without slowing down due to maintenance issues.

perl
Consuming Web Services in Android
Consuming Web Services in AndroidConsuming Web Services in Android
Consuming Web Services in Android

This document discusses consuming web services from mobile applications. It covers common mobile development challenges like limited screen space, CPU power, and bandwidth. It then provides an overview of technologies used to access web services like XML, JSON, REST, and SOAP. Examples are given of using AsyncTask and Services in Android to make asynchronous web service calls. Code demonstrations and additional resources are also referenced.

web serviceandroidrest
GET /index.html

             index.html



          GET /assets/favicon.ico

             favicon.ico
Browser




                                        Server
          GET /assets/application.css

            application.css
GET /index.html

             index.html



          GET /assets/favicon.ico

             favicon.ico
Browser




                                        Server
          GET /assets/application.css

            application.css



          GET /assets/bg.png

            bg.png
GET /index.html

             index.html                 Backend



          GET /assets/favicon.ico

             favicon.ico
Browser




                                            Server
          GET /assets/application.css

            application.css



          GET /assets/bg.png

            bg.png
Page Load Time
        =
  Backend Time
        +
  Frontend Time

Recommended for you

Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?

Talk from Akamai Edge 2014 looking at some of our current web performance optimisation practices and how they may need to change as new standards and protocols emerge

http/2akamaiedgeweb performance
Getting a Grip on CDN Performance - Why and How
Getting a Grip on CDN Performance - Why and HowGetting a Grip on CDN Performance - Why and How
Getting a Grip on CDN Performance - Why and How

View CDN performance data, learn how you can collect data on CDN performance and get tips on improving CDN performance.

cdnspeedweb performance
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets

This document discusses WebSockets as an improvement over previous "fake push" techniques for enabling real-time full duplex communication between web clients and servers. It notes that WebSockets use HTTP for the initial handshake but then provide a persistent, bi-directional connection. Examples are given of how WebSockets work and can be implemented in various programming languages including Ruby. Support in browsers and servers is also discussed.

websockets ruby eventmachine german
Optimisation rule #1
Optimise only when it makes sense
Optimisation rule #1
Optimise only when it makes sense




            * http://www.stevesouders.com/blog/2012/02/10/the-performance-golden-rule/
Waterfall / Firebug
Demo

Recommended for you

Service workers: what and why UmbUKFest 2018!
Service workers: what and why UmbUKFest 2018!Service workers: what and why UmbUKFest 2018!
Service workers: what and why UmbUKFest 2018!

This document compares the performance of normal web page loads to loads that utilize a service worker. It shows that service workers can improve performance by caching resources so that repeat visits are much faster, with the DOM content loading in under 200ms and transferring 0KB of data compared to over 2 seconds and transferring 3KB without a service worker. Resources for learning more about service workers and examples of sites that use them are also provided.

umbracoservice workerjavascript
What does the browser pre-loader do?
What does the browser pre-loader do?What does the browser pre-loader do?
What does the browser pre-loader do?

Slides from talk at London Webstandards (Sept 2014) on what the browser preloader is, how it works and why we need it

browserweb performancelondon web standards
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website Optimization

Yahoo has developed the de facto standard for building fast front-ends for websites. The bad news: you have to follow 34 rules to get there. The good news: I'll take a subset of those rules, explain them, and show how you can implement those rules in an automated fashion to minimize impact on developers and designers for your high-traffic website.

yslowphpoptimization
Sprechen Sie Firebug?
●   Blocking - request is queued and waiting
●   DNS Lookup - time to resolve hostname
●   Connection - time to create TCP connection
●   Sending - sending request headers
●   Waiting - backend is busy now
●   Receiving - reading the response

● blue and red vertical lines:
  DOMContentLoaded and load events
    ○ http://ie.microsoft.
      com/testdrive/HTML5/DOMContentLoaded/Default.
      html
Optimisation rule #2
Download resources in parallel
Resource downloading rules
Clients that use persistent connections
SHOULD limit the number of simultaneous
connections that they maintain to a given
server. A single-user client SHOULD NOT
maintain more than 2 connections with any
server or proxy.

                     -- RFC 2616 (HTTP 1.1)
Demo

Recommended for you

Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets

WebSocket is a protocol that provides bidirectional communication over a single TCP connection. It uses an HTTP handshake to establish a connection and then transmits messages as frames that can contain text or binary data. The frames include a header with metadata like opcode and payload length. WebSocket aims to provide a standard for browser-based applications that require real-time data updates from a server.

html5springjava
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization

80% of the time it takes for a web page to load is on the client side. Using all the tips in this presentation should cut 25% to 50% off the load time of optimized page requests. Drupal (6 or 7) can be used to, fairly easily, implement a whole bunch of these “front-end performance” upgrades, and knock a ton of errors off of the Yahoo! and Google speed-checker tools validation checklists. Get firebug first.

drupalpagespeed upgradespressflow
Improving web site performance and scalability while saving
Improving web site performance and scalability while savingImproving web site performance and scalability while saving
Improving web site performance and scalability while saving

This document discusses various techniques for improving web site performance and scalability while reducing costs, including: 1. Optimizing code to reduce HTTP requests and payload size. 2. Leveraging browser caching through content expiration, HTTP compression, and cache validation. 3. Minifying and consolidating CSS and JavaScript files. 4. Using a content delivery network (CDN) to distribute static assets globally. 5. Caching data and view state to reduce database queries and payload size.

Solution: Asset subdomains
● assets01.domain.com
● assets02.domain.com
● ...

● Extra:
   ○ Cookie-less domain
   ○ HTTP Keep-Alive


● Pitfalls:
   ○ DNS lookups
Optimisation rule #3
Fastest request is the one that doesn't happen
Avada Kedavra Request!
●   Merge
●   Inline
●   Sprite
●   Cache
Merge
● Merge multiple CSS files into a single file
● Merge multiple JS files into a single file
   ○ -> Rails/Sprockets/Asset pipeline
  $ cat app/assets/javascripts/application.js
     //= require jquery_ujs
     //= require_tree ./vendor
     //= require document_viewer/dv
     //= require_tree .

Recommended for you

Front-End Performance Optimizing
Front-End Performance OptimizingFront-End Performance Optimizing
Front-End Performance Optimizing

Front-end performance optimizing involves optimizing a website's HTML, CSS, JavaScript, and image files to achieve the fastest possible loading speed. This includes minimizing HTTP requests by combining files, compressing files, optimizing code by removing unused code and errors, leveraging browser caching, and parallelizing downloads across domains. The document outlines nine techniques for front-end optimization, such as optimizing file sizes, reducing download size through compression and caching, and minimizing HTTP requests through file combining and CSS sprites.

front-endwebsitesoptimizing
Front End Performance
Front End PerformanceFront End Performance
Front End Performance

The document discusses various techniques for improving front-end website performance, including reducing the number of HTTP requests, using content delivery networks and caching, gzip compression, optimizing CSS and JavaScript loading, image optimization, and lazy loading of content not visible initially. Specific techniques mentioned include combining files, setting long cache expiration headers, minifying files, parallelizing downloads, and deferring non-critical JavaScript initialization. The goal is to render an initial version as fast as possible through optimizations that reduce page load time.

drupaldrupalconparistuning
Building Lightning Fast Websites (for Twin Cities .NET User Group)
Building Lightning Fast Websites (for Twin Cities .NET User Group)Building Lightning Fast Websites (for Twin Cities .NET User Group)
Building Lightning Fast Websites (for Twin Cities .NET User Group)

1. A website is loaded by a browser through a multi-step process involving DNS lookups, TCP connections, downloading resources like HTML, CSS, JS, and images. This process can be slow due to the number of individual requests and dependencies between resources. 2. Ways to optimize the loading process include making the server fast, inlining critical resources, gzip compression, an optimized caching strategy, optimizing file delivery through techniques like CDNs and HTTP/2, bundling resources, optimizing images, avoiding unnecessary domains, minimizing web fonts, and JavaScript techniques like PJAX. Minifying assets can also speed up loading.

Inline
● Inline JavaScript
  ○ Replace <script src=".."></script> with
      <script>//code</script>
● Inline CSS
  ○ <style>body { color: red; }</style>
● Usable only for small resources, larger
  resources benefit more from caching
● Inline images using data URIs
   ○ <img src='data:image/jpeg;base64,
     /9j/4AAQSkZJR'/>
   ○ background-image: url(data:image/jpeg;base64,
     /9j/4AAQS);
   ○ Pitfalls: size limit, IE <= 7
Demo
CSS sprites
Merge multiple images
into one, use background-
position to place.
Caching
First request: cache miss, hit the server, obtain
token
Additional requests: use the token from first
request to make conditional request

Conditional requests
● If-None-Match
● If-Modified-Since

Recommended for you

Building Scalable Websites with Perl
Building Scalable Websites with PerlBuilding Scalable Websites with Perl
Building Scalable Websites with Perl

This document discusses techniques for building scalable websites with Perl, including: 1) Caching at various levels (page, partial page, and database caching) to improve performance and reduce load on application servers. 2) Using job queuing and worker processes to distribute processing-intensive tasks asynchronously instead of blocking web requests. 3) Leveraging caching and queueing libraries like Cache::FastMmap, Memcached, and Spread::Queue to implement caching and job queueing in Perl applications.

perl
HTTP2 is Here!
HTTP2 is Here!HTTP2 is Here!
HTTP2 is Here!

HTTP/2 provides improvements over HTTP/1.1 such as multiplexed requests, header compression and priority hints from browsers that can reduce latency. While it shows benefits in testing, real-world impacts may be more modest depending on server and client configurations. Further optimizations are still needed and HTTP/2 opens up new possibilities around features like server pushing and progressive content delivery that could enhance performance.

http2web performance
Lesson 6 optimisation
Lesson 6  optimisationLesson 6  optimisation
Lesson 6 optimisation

This document discusses optimizing graphics for their intended output. It aims to help students consider why graphics need to be optimized for quality and discuss technical aspects like bit depth, resolution, dimensions, file type and compression that must be tailored to the intended output such as screen or web. Students will complete tasks in pairs researching how the final destination of graphics impacts these settings and will write about optimizing graphics using their client brief as a reference.

If-None-Match: First request
First request:

Request headers:
GET /

Response headers:
Status: 200 OK
Etag: "be5c5a3edac0592617693fa..."
If-None-Match: Next requests
Request headers:
GET /
If-None-Match: "be5c5a3edac0592617693fa..."

Response headers:
Status: 304 Not Modified
Etag: "be5c5a3edac0592617693fa..."
If-None-Match
● Server needs to calculate ETag (fingerprint)
● How?
  ○ it depends
  ○ easiest way: generate output, calculate hash
● If ETag matches, send 304 Not Modified, no
  response body
● You save on the data transfer ("Receiving" in
  Firebug)
If-Modified-Since: First request
Request headers:
GET /

Response headers:
Status: 200 OK
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Last-Modified: Mon, 30 Jan 2012 13:36:26 GMT

Recommended for you

New media & technologies of representations
New media & technologies of representationsNew media & technologies of representations
New media & technologies of representations

The document discusses several topics related to new media technologies and their social impact. It covers the rise of user-generated content online, moral panics about new technologies, issues of copyright infringement with digital music, the evolution of the internet to incorporate user interactivity and social media, and how new devices and media platforms are changing representation and culture. New media refers to on-demand digital content across any device as well as interactive and user-generated content online.

File types pro forma
File types pro formaFile types pro forma
File types pro forma

This document discusses different types of digital file formats for graphics, including raster graphics like JPEG, TIFF, GIF, and BMP, as well as vector graphics like PSD, AI, FLA, and WMF. It provides information on what each file format stands for, examples of how it is used, advantages, and disadvantages. Methods for capturing and optimizing images are also covered, such as using scanners, cameras, and graphics tablets. Optimizing images makes the file size smaller but can lower the resolution and quality.

Optimising Graphics
Optimising GraphicsOptimising Graphics
Optimising Graphics

This document discusses optimizing graphics in Adobe Photoshop CS3 by resizing images to reduce both visual size and file size. Optimizing graphics makes images smaller in size but retains enough quality for intended uses like the web or email. The document suggests resizing graphics to around 10 times smaller for optimizing.

If-Modified-Since: Local cache
Request headers:
none

Response headers:
none

Current time is < resource's Expire header
If-Modified-Since: Forced refresh
Request headers:
GET /
If-Modified-Since: Mon, 30 Jan 2012 13:36:26
GMT

Response headers:
Status: 304 Not Modified
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Last-Modified: Mon, 30 Jan 2012 13:36:26 GMT
Refresh
Regular click on a link: uses local cache and no
request is made

F5: Skips local cache, sends If-Modified-Since
request, potentially 304-ing

Ctrl+F5: Sends requests without If-None-
Match and If-Modified-Since
Demo

Recommended for you

Legal Aspects Of New Media 2nd Annual New Media
Legal Aspects Of New Media   2nd Annual New MediaLegal Aspects Of New Media   2nd Annual New Media
Legal Aspects Of New Media 2nd Annual New Media

This is my presentation which I will be giving on 27 March 2008 at the 2nd Annual New Media Marketing Conference at Gallagher Estate, Midrand, South Africa

Legal Aspects of Social Media
Legal Aspects of Social MediaLegal Aspects of Social Media
Legal Aspects of Social Media

Social media has come a long way in a very short time and organisations are struggling to keep up. What started as a clever way to keep in touch with old school friends ten years ago has become a core part of the work of many people and their employers and so it is vital that use of social media is compliant with the laws of the land and works as a promotional tool and not a source of potential risk. Matthew Stephenson, head of information governance at the University of Salford and chairman of the Information and Records Management Society will guide you through this complex and uncertain area. Presentation by Matthew Stephenson, delivered at UCISA Using Social Media for Training on 18/04/2012.

legalcopyrightucisa
Optimising your web application
Optimising your web applicationOptimising your web application
Optimising your web application

Praveen Umanath, Product Manager at BigRock conducts a session on how to optimise web applications at httpX 2013, New Delhi

web applicationbigrockhttpx
Far future expires strategy
Set the Expires header far in the future

FAQ
Q: But what if I need to change the resource?
A: Use a different name

    application-f7fd224c9bc0fd4c2f7.css
                        fingerprint
Rails gotcha
Asset pipeline sets fingerprints, but not Expire
headers. You need to DIY.

Nginx:

location ~* .(js|css|jpg|jpeg|gif|png|swf|ico)$ {
  expires max;
}
Optimisation rule #3
If you need to make the request, make the
response (and request) small.
Follow these rules
● Minify and gzip CSS and JavaScript.
● Do not send/set cookies unless necessary
  (asset subdomains)
● Do not scale images in HTML
  ○ do not use <img size=""/>, scale image on server
● Optimize images
  ○ http://www.smushit.com/ysmush.it/

Recommended for you

St14 electrical detroit upgrade mod
St14 electrical detroit upgrade modSt14 electrical detroit upgrade mod
St14 electrical detroit upgrade mod

ST 14 ATLAS COPCO

L 150 e-_sensor
L 150 e-_sensorL 150 e-_sensor
L 150 e-_sensor

This document repeats the phrases "¡¦£" and "! " " !#$%" multiple times with no other discernible words or context. It concludes with repeating the phrase "! " " !#$%".

Tim Hill 4.4 PPP Presentation
Tim Hill 4.4 PPP PresentationTim Hill 4.4 PPP Presentation
Tim Hill 4.4 PPP Presentation

Tim grew up loving animation and used toys to tell stories. He studied computer animation in college and learned skills like 3D modeling. His goal is to have a career in character creation or animation and someday open his own studio. He hopes to use his creative skills, problem-solving abilities, and teamwork from his family to succeed in the animation industry.

imaginativeanimationanimator
Optimisation rule #4
If possible, defer parsing of JavaScripts
How browsers process JavaScript
When browsers encounter <script> tag, the
script is downloaded, parsed and executed.
Main parsing thread is busy processing the
script.

Speculative parsing continues downloading and
building the DOM in the background, so main
thread can pull this fast, but you still pay the
parse and execute penalty.
Do you need to execute the script
immediately?
Probably not.

Is your code waiting for document.ready?
Mouse action?

Then definitely not.
Then defer it
<script type="text/javascript">
function downloadJSAtOnload() {
  var element = document.createElement("script");
  element.src = "application.js";
  document.body.appendChild(element);
}

if (window.addEventListener)
  window.addEventListener("load", downloadJSAtOnload,
false);
else if (window.attachEvent)
  window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>

Recommended for you

18 Phobias Every Creative MUST Overcome!
18 Phobias Every Creative MUST Overcome!18 Phobias Every Creative MUST Overcome!
18 Phobias Every Creative MUST Overcome!

This document lists 18 different phobias that creatives must overcome, including the fear of empty spaces, colors, imperfection, praise, vertigo, words, paper, shadows, balancing, and images or icons. It encourages creatives to face their fears in order to improve their work by addressing phobias such as the fear of colors, straight lines, praise, or clusters of shapes. The list covers a wide range of potential phobias or anxieties that may hold creatives back from reaching their full potential.

designsmall and medium enterprisesdiy wedding monograms
Euruko 2009 - DataObjects
Euruko 2009 - DataObjectsEuruko 2009 - DataObjects
Euruko 2009 - DataObjects

This document discusses connecting to different database systems like MySQL, Oracle, PostgreSQL, and SQLite using DataObjects and retrieving data using commands. It demonstrates how to execute queries, retrieve result sets and field values, and handle data typecasting between the database and Ruby types. It also mentions implementing specs to test the database adapters according to standard specifications and supporting the BigDecimal type.

dataobjectsdata_objects
Parker Devonne 3.4
Parker Devonne 3.4Parker Devonne 3.4
Parker Devonne 3.4

The document appears to be a collection of thoughts on art and career from an individual. It discusses taking various art courses and learning different styles. Projects mentioned include designing an album cover for a band and creating spreads, flyers, and nameplates for class. The person views their creativity as an advantage and defines success as financial stability, happiness, and being able to provide for others.

Demo
Optimisation rule #5
As a last resort: simply cheat.
Perceived speed matters
Move all CSS to the top so DOM nodes can be
rendered progressively
If you cannot defer, at least move <script> to
the bottom of the page.
Post-load parts of page that are slow to render.
Optimisation rule #5
Think globally.

Recommended for you

WordPress Training Beginner
WordPress Training BeginnerWordPress Training Beginner
WordPress Training Beginner

This document provides an overview of a WordPress training course presented by John Overall of FireDragonHosting.com. It begins with a Henry Ford quote about building a reputation through actions rather than plans. The document then gives a brief history of WordPress starting in 2003 with basic typography enhancements. It outlines the main sections of the WordPress admin dashboard including general settings, managing pages, posts, and blogroll links.

wordpresswordpress training
56 alumbrado
56 alumbrado56 alumbrado
56 alumbrado

El documento habla sobre un proyecto de investigación que estudia el comportamiento de los consumidores. El proyecto analiza cómo los consumidores toman decisiones sobre qué productos comprar y cómo las empresas pueden usar esta información para mejorar sus estrategias de marketing. El documento no proporciona más detalles sobre el proyecto debido a que las páginas están en blanco.

MongoDB: Repository for Web-scale metadata
MongoDB: Repository for Web-scale metadataMongoDB: Repository for Web-scale metadata
MongoDB: Repository for Web-scale metadata
Location matters
Downloading image placed on a server in
Slovakia is relatively cheap than say
downloading the same image from Canada.
Use CDN (content delivery network)
Servers spread through the world.

Use CDN on common assets (jQuery etc.).
Chance is, you will get a cache hit.

https://developers.google.com/speed/libraries/
Tools
Web Page Test, http://www.webpagetest.org/
Newrelic RUM, http://newrelic.com
Optimising Web Application Frontend

Recommended for you

Instant Rails
Instant RailsInstant Rails
Instant Rails

1) A Rails application called "mybookshelf" was created with the default files and directories. 2) The database configuration file was set up to use a MySQL database called "mybookshelf_development". 3) A migration was generated to create a Books table with ISBN, title, and review attributes and run to set up the database. 4) A scaffold was generated for the Book model to provide default views, helpers, and layout for managing books.

How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.

Install Magento 2 on Window's environment (XAMPP) by just following the using some simple steps which has been created by our Magent Expert. Do check it and let us know if there are any issue you faced.

magento2.0marketingmagento
John Overall at Word Camp Victoria 2011
John Overall at Word Camp Victoria 2011John Overall at Word Camp Victoria 2011
John Overall at Word Camp Victoria 2011

This document discusses 9 popular WordPress plugins that can enhance a website: WP-Touch makes websites mobile-friendly with a few simple settings. WordBooker and Twitter Blog easily connect websites to Facebook and Twitter with automated updates. Gravity Forms allows easy creation of forms. Mail Press manages email lists and subscriptions. Blubrry Power Press easily adds podcasts. XML Sitemaps and iRobots.txt help with search engine optimization. Headspace 2 allows control over SEO. These plugins can help improve websites with usability and marketing features.

wordpresspodcastingwordcamp
Optimising Web Application Frontend
Optimising Web Application Frontend
Optimising Web Application Frontend
Is this all I can do?
Definitely not.

Google Page Speed, http://developers.google.
com/speed/pagespeed/
YSlow, http://yslow.org/

Recommended for you

jclouds overview
jclouds overviewjclouds overview
jclouds overview

jclouds is a Java multi-cloud SDK that connects tools portably to over 40 cloud providers through consistent APIs. It helps projects become cloud projects by simplifying modeling of cloud services through standards-focused APIs and strategies for addressing service differences. Code examples show initializing contexts for the CloudFiles blob store and OpenStack Nova compute service to create containers, upload blobs, and launch virtual machines across different cloud providers using a common API approach.

javaclojurecloud
Frontend performance
Frontend performanceFrontend performance
Frontend performance

The document provides best practices for optimizing frontend performance by reducing page load time. It discusses ways to reduce the number of HTTP requests, DNS lookups, redirects and duplicate scripts. It also recommends techniques like minifying assets, leveraging caching, prioritizing critical components, optimizing images and using content delivery networks.

performancefrontend
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers

We all know that site speed matters not only for users but also for search rankings. As marketers, how can we measure and improve the impact of site speed? Mat will cover a range of topics and tools, from the basic quick wins to some of the more surprising and cutting-edge techniques used by the largest websites in the world.

searchlovesearchlove san diegosite speed
Optimising Web Application Frontend
Future
SPDY
HTTP archives
local storage
Summary
1. Optimise only when it makes sense
2. Download resources in parallel
3. Fastest request is the one that doesn't
   happen
4. If you need to make the request, make the
   response (and request) small
5. If possible, defer parsing of JavaScripts
6. Think globally

More Related Content

What's hot

Performance Of Web Applications On Client Machines
Performance Of Web Applications On Client MachinesPerformance Of Web Applications On Client Machines
Performance Of Web Applications On Client Machines
Curelet Marius
 
.htaccess for SEOs - A presentation by Roxana Stingu
.htaccess for SEOs - A presentation by Roxana Stingu.htaccess for SEOs - A presentation by Roxana Stingu
.htaccess for SEOs - A presentation by Roxana Stingu
Roxana Stingu
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
Perrin Harkins
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance
Eric ShangKuan
 
Care and feeding notes
Care and feeding notesCare and feeding notes
Care and feeding notes
Perrin Harkins
 
Consuming Web Services in Android
Consuming Web Services in AndroidConsuming Web Services in Android
Consuming Web Services in Android
David Truxall
 
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?
Andy Davies
 
Getting a Grip on CDN Performance - Why and How
Getting a Grip on CDN Performance - Why and HowGetting a Grip on CDN Performance - Why and How
Getting a Grip on CDN Performance - Why and How
Aaron Peters
 
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets
Roland M
 
Service workers: what and why UmbUKFest 2018!
Service workers: what and why UmbUKFest 2018!Service workers: what and why UmbUKFest 2018!
Service workers: what and why UmbUKFest 2018!
Matthew Wise
 
What does the browser pre-loader do?
What does the browser pre-loader do?What does the browser pre-loader do?
What does the browser pre-loader do?
Andy Davies
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website Optimization
Gerard Sychay
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
Gunnar Hillert
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
Stevie T
 
Improving web site performance and scalability while saving
Improving web site performance and scalability while savingImproving web site performance and scalability while saving
Improving web site performance and scalability while saving
mdc11
 
Front-End Performance Optimizing
Front-End Performance OptimizingFront-End Performance Optimizing
Front-End Performance Optimizing
Michael Pehl
 
Front End Performance
Front End PerformanceFront End Performance
Front End Performance
Konstantin Käfer
 
Building Lightning Fast Websites (for Twin Cities .NET User Group)
Building Lightning Fast Websites (for Twin Cities .NET User Group)Building Lightning Fast Websites (for Twin Cities .NET User Group)
Building Lightning Fast Websites (for Twin Cities .NET User Group)
strommen
 
Building Scalable Websites with Perl
Building Scalable Websites with PerlBuilding Scalable Websites with Perl
Building Scalable Websites with Perl
Perrin Harkins
 
HTTP2 is Here!
HTTP2 is Here!HTTP2 is Here!
HTTP2 is Here!
Andy Davies
 

What's hot (20)

Performance Of Web Applications On Client Machines
Performance Of Web Applications On Client MachinesPerformance Of Web Applications On Client Machines
Performance Of Web Applications On Client Machines
 
.htaccess for SEOs - A presentation by Roxana Stingu
.htaccess for SEOs - A presentation by Roxana Stingu.htaccess for SEOs - A presentation by Roxana Stingu
.htaccess for SEOs - A presentation by Roxana Stingu
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance
 
Care and feeding notes
Care and feeding notesCare and feeding notes
Care and feeding notes
 
Consuming Web Services in Android
Consuming Web Services in AndroidConsuming Web Services in Android
Consuming Web Services in Android
 
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?
 
Getting a Grip on CDN Performance - Why and How
Getting a Grip on CDN Performance - Why and HowGetting a Grip on CDN Performance - Why and How
Getting a Grip on CDN Performance - Why and How
 
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets
 
Service workers: what and why UmbUKFest 2018!
Service workers: what and why UmbUKFest 2018!Service workers: what and why UmbUKFest 2018!
Service workers: what and why UmbUKFest 2018!
 
What does the browser pre-loader do?
What does the browser pre-loader do?What does the browser pre-loader do?
What does the browser pre-loader do?
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website Optimization
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
 
Improving web site performance and scalability while saving
Improving web site performance and scalability while savingImproving web site performance and scalability while saving
Improving web site performance and scalability while saving
 
Front-End Performance Optimizing
Front-End Performance OptimizingFront-End Performance Optimizing
Front-End Performance Optimizing
 
Front End Performance
Front End PerformanceFront End Performance
Front End Performance
 
Building Lightning Fast Websites (for Twin Cities .NET User Group)
Building Lightning Fast Websites (for Twin Cities .NET User Group)Building Lightning Fast Websites (for Twin Cities .NET User Group)
Building Lightning Fast Websites (for Twin Cities .NET User Group)
 
Building Scalable Websites with Perl
Building Scalable Websites with PerlBuilding Scalable Websites with Perl
Building Scalable Websites with Perl
 
HTTP2 is Here!
HTTP2 is Here!HTTP2 is Here!
HTTP2 is Here!
 

Viewers also liked

Lesson 6 optimisation
Lesson 6  optimisationLesson 6  optimisation
Lesson 6 optimisation
hwells2101
 
New media & technologies of representations
New media & technologies of representationsNew media & technologies of representations
New media & technologies of representations
Ty171
 
File types pro forma
File types pro formaFile types pro forma
File types pro forma
emma_crampton
 
Optimising Graphics
Optimising GraphicsOptimising Graphics
Optimising Graphics
Sutinder Mann
 
Legal Aspects Of New Media 2nd Annual New Media
Legal Aspects Of New Media   2nd Annual New MediaLegal Aspects Of New Media   2nd Annual New Media
Legal Aspects Of New Media 2nd Annual New Media
Paul Jacobson
 
Legal Aspects of Social Media
Legal Aspects of Social MediaLegal Aspects of Social Media
Legal Aspects of Social Media
Phil Vincent
 
Optimising your web application
Optimising your web applicationOptimising your web application
Optimising your web application
BigRock India
 
St14 electrical detroit upgrade mod
St14 electrical detroit upgrade modSt14 electrical detroit upgrade mod
St14 electrical detroit upgrade mod
Alex cuevas
 
L 150 e-_sensor
L 150 e-_sensorL 150 e-_sensor
L 150 e-_sensor
Alex cuevas
 
Tim Hill 4.4 PPP Presentation
Tim Hill 4.4 PPP PresentationTim Hill 4.4 PPP Presentation
Tim Hill 4.4 PPP Presentation
timothyghill
 
18 Phobias Every Creative MUST Overcome!
18 Phobias Every Creative MUST Overcome!18 Phobias Every Creative MUST Overcome!
18 Phobias Every Creative MUST Overcome!
DesignMantic
 
Euruko 2009 - DataObjects
Euruko 2009 - DataObjectsEuruko 2009 - DataObjects
Euruko 2009 - DataObjects
Dirkjan Bussink
 
Parker Devonne 3.4
Parker Devonne 3.4Parker Devonne 3.4
Parker Devonne 3.4
Devo TKid
 
WordPress Training Beginner
WordPress Training BeginnerWordPress Training Beginner
WordPress Training Beginner
John Overall
 
56 alumbrado
56 alumbrado56 alumbrado
56 alumbrado
Alex cuevas
 
MongoDB: Repository for Web-scale metadata
MongoDB: Repository for Web-scale metadataMongoDB: Repository for Web-scale metadata
MongoDB: Repository for Web-scale metadata
tkramar
 
Instant Rails
Instant RailsInstant Rails
Instant Rails
Yoshiyuki MIKAMI
 
How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.
Web Visitors
 
John Overall at Word Camp Victoria 2011
John Overall at Word Camp Victoria 2011John Overall at Word Camp Victoria 2011
John Overall at Word Camp Victoria 2011
John Overall
 
jclouds overview
jclouds overviewjclouds overview
jclouds overview
Adrian Cole
 

Viewers also liked (20)

Lesson 6 optimisation
Lesson 6  optimisationLesson 6  optimisation
Lesson 6 optimisation
 
New media & technologies of representations
New media & technologies of representationsNew media & technologies of representations
New media & technologies of representations
 
File types pro forma
File types pro formaFile types pro forma
File types pro forma
 
Optimising Graphics
Optimising GraphicsOptimising Graphics
Optimising Graphics
 
Legal Aspects Of New Media 2nd Annual New Media
Legal Aspects Of New Media   2nd Annual New MediaLegal Aspects Of New Media   2nd Annual New Media
Legal Aspects Of New Media 2nd Annual New Media
 
Legal Aspects of Social Media
Legal Aspects of Social MediaLegal Aspects of Social Media
Legal Aspects of Social Media
 
Optimising your web application
Optimising your web applicationOptimising your web application
Optimising your web application
 
St14 electrical detroit upgrade mod
St14 electrical detroit upgrade modSt14 electrical detroit upgrade mod
St14 electrical detroit upgrade mod
 
L 150 e-_sensor
L 150 e-_sensorL 150 e-_sensor
L 150 e-_sensor
 
Tim Hill 4.4 PPP Presentation
Tim Hill 4.4 PPP PresentationTim Hill 4.4 PPP Presentation
Tim Hill 4.4 PPP Presentation
 
18 Phobias Every Creative MUST Overcome!
18 Phobias Every Creative MUST Overcome!18 Phobias Every Creative MUST Overcome!
18 Phobias Every Creative MUST Overcome!
 
Euruko 2009 - DataObjects
Euruko 2009 - DataObjectsEuruko 2009 - DataObjects
Euruko 2009 - DataObjects
 
Parker Devonne 3.4
Parker Devonne 3.4Parker Devonne 3.4
Parker Devonne 3.4
 
WordPress Training Beginner
WordPress Training BeginnerWordPress Training Beginner
WordPress Training Beginner
 
56 alumbrado
56 alumbrado56 alumbrado
56 alumbrado
 
MongoDB: Repository for Web-scale metadata
MongoDB: Repository for Web-scale metadataMongoDB: Repository for Web-scale metadata
MongoDB: Repository for Web-scale metadata
 
Instant Rails
Instant RailsInstant Rails
Instant Rails
 
How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.
 
John Overall at Word Camp Victoria 2011
John Overall at Word Camp Victoria 2011John Overall at Word Camp Victoria 2011
John Overall at Word Camp Victoria 2011
 
jclouds overview
jclouds overviewjclouds overview
jclouds overview
 

Similar to Optimising Web Application Frontend

Frontend performance
Frontend performanceFrontend performance
Frontend performance
sacred 8
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
Distilled
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
Siarhei Barysiuk
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
Anup Hariharan Nair
 
High-Speed HTML5
High-Speed HTML5High-Speed HTML5
High-Speed HTML5
Peter Lubbers
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing
Roman Ananev
 
DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators
DEF CON 27 - BEN SADEGHIPOUR  - owning the clout through ssrf and pdf generatorsDEF CON 27 - BEN SADEGHIPOUR  - owning the clout through ssrf and pdf generators
DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators
Felipe Prado
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Doris Chen
 
5 critical-optimizations.v2
5 critical-optimizations.v25 critical-optimizations.v2
5 critical-optimizations.v2
Blaze Software Inc.
 
High performance website
High performance websiteHigh performance website
High performance website
Chamnap Chhorn
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
fakeaccount225095
 
High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practices
Stoyan Stefanov
 
implement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflowimplement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflow
WordPress
 
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
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013
Santiago Aimetta
 
Building performance into the new yahoo homepage presentation
Building performance into the new yahoo  homepage presentationBuilding performance into the new yahoo  homepage presentation
Building performance into the new yahoo homepage presentation
masudakram
 
Performance on the Yahoo! Homepage
Performance on the Yahoo! HomepagePerformance on the Yahoo! Homepage
Performance on the Yahoo! Homepage
Nicholas Zakas
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
Sam Keen
 
Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test
Rashmi Sinha
 

Similar to Optimising Web Application Frontend (20)

Frontend performance
Frontend performanceFrontend performance
Frontend performance
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
High-Speed HTML5
High-Speed HTML5High-Speed HTML5
High-Speed HTML5
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing
 
DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators
DEF CON 27 - BEN SADEGHIPOUR  - owning the clout through ssrf and pdf generatorsDEF CON 27 - BEN SADEGHIPOUR  - owning the clout through ssrf and pdf generators
DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 
5 critical-optimizations.v2
5 critical-optimizations.v25 critical-optimizations.v2
5 critical-optimizations.v2
 
High performance website
High performance websiteHigh performance website
High performance website
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practices
 
implement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflowimplement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflow
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
 
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...
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013
 
Building performance into the new yahoo homepage presentation
Building performance into the new yahoo  homepage presentationBuilding performance into the new yahoo  homepage presentation
Building performance into the new yahoo homepage presentation
 
Performance on the Yahoo! Homepage
Performance on the Yahoo! HomepagePerformance on the Yahoo! Homepage
Performance on the Yahoo! Homepage
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test
 

More from tkramar

Lessons learned from SearchD development
Lessons learned from SearchD developmentLessons learned from SearchD development
Lessons learned from SearchD development
tkramar
 
Learning to rank fulltext results from clicks
Learning to rank fulltext results from clicksLearning to rank fulltext results from clicks
Learning to rank fulltext results from clicks
tkramar
 
Live Streaming & Server Sent Events
Live Streaming & Server Sent EventsLive Streaming & Server Sent Events
Live Streaming & Server Sent Events
tkramar
 
Unix is my IDE
Unix is my IDEUnix is my IDE
Unix is my IDE
tkramar
 
Cassandra: Indexing and discovering similar images
Cassandra: Indexing and discovering similar imagesCassandra: Indexing and discovering similar images
Cassandra: Indexing and discovering similar images
tkramar
 
CouchDB: replicated data store for distributed proxy server
CouchDB: replicated data store for distributed proxy serverCouchDB: replicated data store for distributed proxy server
CouchDB: replicated data store for distributed proxy server
tkramar
 
Ruby vim
Ruby vimRuby vim
Ruby vim
tkramar
 

More from tkramar (7)

Lessons learned from SearchD development
Lessons learned from SearchD developmentLessons learned from SearchD development
Lessons learned from SearchD development
 
Learning to rank fulltext results from clicks
Learning to rank fulltext results from clicksLearning to rank fulltext results from clicks
Learning to rank fulltext results from clicks
 
Live Streaming & Server Sent Events
Live Streaming & Server Sent EventsLive Streaming & Server Sent Events
Live Streaming & Server Sent Events
 
Unix is my IDE
Unix is my IDEUnix is my IDE
Unix is my IDE
 
Cassandra: Indexing and discovering similar images
Cassandra: Indexing and discovering similar imagesCassandra: Indexing and discovering similar images
Cassandra: Indexing and discovering similar images
 
CouchDB: replicated data store for distributed proxy server
CouchDB: replicated data store for distributed proxy serverCouchDB: replicated data store for distributed proxy server
CouchDB: replicated data store for distributed proxy server
 
Ruby vim
Ruby vimRuby vim
Ruby vim
 

Recently uploaded

[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 

Recently uploaded (20)

[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 

Optimising Web Application Frontend

  • 1. Optimising Web application frontend Tomáš Kramár, @tkramar
  • 2. What happens when I type address into browser?
  • 3. GET /index.html GET /index.html Browser Server
  • 4. GET /index.html index.html GET /assets/favicon.ico favicon.ico Browser Server
  • 5. GET /index.html index.html GET /assets/favicon.ico favicon.ico Browser Server GET /assets/application.css application.css
  • 6. GET /index.html index.html GET /assets/favicon.ico favicon.ico Browser Server GET /assets/application.css application.css GET /assets/bg.png bg.png
  • 7. GET /index.html index.html Backend GET /assets/favicon.ico favicon.ico Browser Server GET /assets/application.css application.css GET /assets/bg.png bg.png
  • 8. Page Load Time = Backend Time + Frontend Time
  • 9. Optimisation rule #1 Optimise only when it makes sense
  • 10. Optimisation rule #1 Optimise only when it makes sense * http://www.stevesouders.com/blog/2012/02/10/the-performance-golden-rule/
  • 12. Demo
  • 13. Sprechen Sie Firebug? ● Blocking - request is queued and waiting ● DNS Lookup - time to resolve hostname ● Connection - time to create TCP connection ● Sending - sending request headers ● Waiting - backend is busy now ● Receiving - reading the response ● blue and red vertical lines: DOMContentLoaded and load events ○ http://ie.microsoft. com/testdrive/HTML5/DOMContentLoaded/Default. html
  • 14. Optimisation rule #2 Download resources in parallel
  • 15. Resource downloading rules Clients that use persistent connections SHOULD limit the number of simultaneous connections that they maintain to a given server. A single-user client SHOULD NOT maintain more than 2 connections with any server or proxy. -- RFC 2616 (HTTP 1.1)
  • 16. Demo
  • 17. Solution: Asset subdomains ● assets01.domain.com ● assets02.domain.com ● ... ● Extra: ○ Cookie-less domain ○ HTTP Keep-Alive ● Pitfalls: ○ DNS lookups
  • 18. Optimisation rule #3 Fastest request is the one that doesn't happen
  • 19. Avada Kedavra Request! ● Merge ● Inline ● Sprite ● Cache
  • 20. Merge ● Merge multiple CSS files into a single file ● Merge multiple JS files into a single file ○ -> Rails/Sprockets/Asset pipeline $ cat app/assets/javascripts/application.js //= require jquery_ujs //= require_tree ./vendor //= require document_viewer/dv //= require_tree .
  • 21. Inline ● Inline JavaScript ○ Replace <script src=".."></script> with <script>//code</script> ● Inline CSS ○ <style>body { color: red; }</style> ● Usable only for small resources, larger resources benefit more from caching ● Inline images using data URIs ○ <img src='data:image/jpeg;base64, /9j/4AAQSkZJR'/> ○ background-image: url(data:image/jpeg;base64, /9j/4AAQS); ○ Pitfalls: size limit, IE <= 7
  • 22. Demo
  • 23. CSS sprites Merge multiple images into one, use background- position to place.
  • 24. Caching First request: cache miss, hit the server, obtain token Additional requests: use the token from first request to make conditional request Conditional requests ● If-None-Match ● If-Modified-Since
  • 25. If-None-Match: First request First request: Request headers: GET / Response headers: Status: 200 OK Etag: "be5c5a3edac0592617693fa..."
  • 26. If-None-Match: Next requests Request headers: GET / If-None-Match: "be5c5a3edac0592617693fa..." Response headers: Status: 304 Not Modified Etag: "be5c5a3edac0592617693fa..."
  • 27. If-None-Match ● Server needs to calculate ETag (fingerprint) ● How? ○ it depends ○ easiest way: generate output, calculate hash ● If ETag matches, send 304 Not Modified, no response body ● You save on the data transfer ("Receiving" in Firebug)
  • 28. If-Modified-Since: First request Request headers: GET / Response headers: Status: 200 OK Expires: Thu, 31 Dec 2037 23:55:55 GMT Last-Modified: Mon, 30 Jan 2012 13:36:26 GMT
  • 29. If-Modified-Since: Local cache Request headers: none Response headers: none Current time is < resource's Expire header
  • 30. If-Modified-Since: Forced refresh Request headers: GET / If-Modified-Since: Mon, 30 Jan 2012 13:36:26 GMT Response headers: Status: 304 Not Modified Expires: Thu, 31 Dec 2037 23:55:55 GMT Last-Modified: Mon, 30 Jan 2012 13:36:26 GMT
  • 31. Refresh Regular click on a link: uses local cache and no request is made F5: Skips local cache, sends If-Modified-Since request, potentially 304-ing Ctrl+F5: Sends requests without If-None- Match and If-Modified-Since
  • 32. Demo
  • 33. Far future expires strategy Set the Expires header far in the future FAQ Q: But what if I need to change the resource? A: Use a different name application-f7fd224c9bc0fd4c2f7.css fingerprint
  • 34. Rails gotcha Asset pipeline sets fingerprints, but not Expire headers. You need to DIY. Nginx: location ~* .(js|css|jpg|jpeg|gif|png|swf|ico)$ { expires max; }
  • 35. Optimisation rule #3 If you need to make the request, make the response (and request) small.
  • 36. Follow these rules ● Minify and gzip CSS and JavaScript. ● Do not send/set cookies unless necessary (asset subdomains) ● Do not scale images in HTML ○ do not use <img size=""/>, scale image on server ● Optimize images ○ http://www.smushit.com/ysmush.it/
  • 37. Optimisation rule #4 If possible, defer parsing of JavaScripts
  • 38. How browsers process JavaScript When browsers encounter <script> tag, the script is downloaded, parsed and executed. Main parsing thread is busy processing the script. Speculative parsing continues downloading and building the DOM in the background, so main thread can pull this fast, but you still pay the parse and execute penalty.
  • 39. Do you need to execute the script immediately? Probably not. Is your code waiting for document.ready? Mouse action? Then definitely not.
  • 40. Then defer it <script type="text/javascript"> function downloadJSAtOnload() { var element = document.createElement("script"); element.src = "application.js"; document.body.appendChild(element); } if (window.addEventListener) window.addEventListener("load", downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent("onload", downloadJSAtOnload); else window.onload = downloadJSAtOnload; </script>
  • 41. Demo
  • 42. Optimisation rule #5 As a last resort: simply cheat.
  • 43. Perceived speed matters Move all CSS to the top so DOM nodes can be rendered progressively If you cannot defer, at least move <script> to the bottom of the page. Post-load parts of page that are slow to render.
  • 45. Location matters Downloading image placed on a server in Slovakia is relatively cheap than say downloading the same image from Canada.
  • 46. Use CDN (content delivery network) Servers spread through the world. Use CDN on common assets (jQuery etc.). Chance is, you will get a cache hit. https://developers.google.com/speed/libraries/
  • 47. Tools Web Page Test, http://www.webpagetest.org/ Newrelic RUM, http://newrelic.com
  • 52. Is this all I can do? Definitely not. Google Page Speed, http://developers.google. com/speed/pagespeed/ YSlow, http://yslow.org/
  • 55. Summary 1. Optimise only when it makes sense 2. Download resources in parallel 3. Fastest request is the one that doesn't happen 4. If you need to make the request, make the response (and request) small 5. If possible, defer parsing of JavaScripts 6. Think globally