SlideShare a Scribd company logo
Web & Mobile
optimization




   by Kirill Cebotari
  drupal.org @oresh
Content table

1. Why optimize?
2. Javascript optimize.
3. CSS optimization.
4. Image optimization.
5. Http requests.
6. Drupal modules.
7. Demo
Why optimize?
i can run 2.37 miles
while i get to the contacts page


                               i'm still loading...
— No need to worry, just running by...
Mobile and web optimization + Drupal
ok, open this page
 waiting...
  I'm hungry
     cook something for dinner
     meeh...
     I'm going to Mo's
      *going away



    1 second is the focus time
Traffic can be expensive
Javascript optimization
It's 3.57 PetaFlops, Chubaka!
Mobile and web optimization + Drupal
Make tests   http://jsperf.com/math-floor-vs-math-round-vs-parseint/5
Follow good practices
http://www.javascripttoolbox.com/bestpractices/
http://coding.smashingmagazine.com/2012/11/05/writing-fast-memory-efficient-
javascript/
http://www.html5rocks.com/en/tutorials/speed/v8/
http://jonraasch.com/blog/10-javascript-performance-boosting-tips-from-nicholas-zakas
http://net.tutsplus.com/tutorials/javascript-ajax/24-javascript-best-practices-for-
beginners/
http://docs.webplatform.org/wiki/javascript


And many others...
Use JSLint




JSLint is a JavaScript program that looks for
problems in JavaScript programs. It is a code
quality tool. Like a Boss.
Keep experimenting.
http://tutorialzine.com/2013/04/50-amazing-jquery-plugins/
CSS optimization
Use SMACSS or similar principles




                         chop chop chop chop...
Don't slow down your selectors

                                                     two more divs
                                                     and I'm home...




body div#content .content > div > div> ul.menu li[class~="item"] ul li
CSS Selectors speed
   I.   ID ( #top )
  II.   Class ( .container )
 III.   Node/Element Type ( div )
  IV.   Sibling ( p + img )
   V.   Child ( ul > li )
  VI.   Descendant ( p strong )
 VII.   Universal ( * )
VIII.   By Attribute ( [type="text"] )
  IX.   Pseudo Elements/Classes ( a:hover )
I.   ID ( #top )
  II.   Class ( .container )
 III.   Node/Element Type ( div )
  IV.   Sibling ( p + img )
   V.   Child ( ul > li )
  VI.   Descendant ( p strong )
 VII.   Universal ( * )
VIII.   By Attribute ( [type="text"] )
  IX.   Pseudo Elements/Classes ( a:hover )
Whyyyy so slow?!??!?!
Use SASS or LESS
Y U No let me use !important ?!
Image optimization
Image impact:

   simple page
   with images


                  simple page
                 without images
                                     optimized
                                   simple page
                                  without images
5MB image on
frontpage? Sure!
Use tiny png




               *he'll eat out all your
               KBytes
Choose wisely




        *http://luci.criosweb.ro/riot/
Optimize your images
before uploading
http://www.smashingmagazine.com/2009/07/01/clever-jpeg-optimization-
techniques/

http://sixrevisions.com/tools/8-excellent-tools-for-optimizing-your-images/

http://www.imageoptimizer.net/Pages/Home.aspx
love sprites
Use CSS3 Gradients




                     *css is awesome!
HTTP requests
It really matters
IE 6/7: 2
IE 8: 2 on dialup, 6 on broadband
IE 9: 6
IE 10: 8
Firefox: 6-8
Safari: 4-6
Chrome: 6-12
Review your files
Parallel Downloads




http://yuiblog.com/blog/2007/04/11/performance-research-part-4/
http://css-tricks.com/images-on-a-subdomain/
Drupal projects.
Break points
http://drupal.org/project/breakpoints
Responsive images
Responsive images and styles
project:
http://drupal.org/project/resp_img

video:
http://modulesunraveled.com/responsive-images/part-1-installation

documentation:
http://drupal.org/node/1904690
Simular projects
1) Responsive Images
 - works as a field formatter
 - only supports 2 sizes
2) Adaptive Image
 - works with screen size, not window size
3) Adaptive Image Styles (ais)
 - needs .htaccess rules
4) Client-side adaptive image
 - works as a field formatter
5) Media: Responsive
 - works only on media field
 - set as maximum width
 - uses css for the smaller variants
Demo and browser tools.
Thank you!




Kirill Cebotari
drupal.org @oresh

irc: #drupal-mobile

More Related Content

PDF
Specialisation 1-jquery-basics
PPTX
Meetup Member Sites - March 2010
PPTX
Graham Lavender on blogs and Twitter at John Abbott 2010
PPTX
Online Portfolio
PDF
Drupal 8 theming principles
PDF
Multi-label Classification with Meta-labels
PPT
2.8 accuracy and ensemble methods
PDF
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?
Specialisation 1-jquery-basics
Meetup Member Sites - March 2010
Graham Lavender on blogs and Twitter at John Abbott 2010
Online Portfolio
Drupal 8 theming principles
Multi-label Classification with Meta-labels
2.8 accuracy and ensemble methods
Are Today’s Good Practices… Tomorrow’s Performance Anti-Patterns?

Similar to Mobile and web optimization + Drupal (20)

PDF
HTML5 Who what where when why how
PPTX
JavaScript performance patterns
PPT
Build Your Own CMS with Apache Sling
PDF
10 Web Performance Lessons For the 21st Century
PPTX
SPSDenver - SharePoint & jQuery - What I wish I would have known
PPTX
JavaScript Performance Patterns
PDF
Developing web applications in 2010
PPTX
Introduction to jQuery
PDF
Stefan Judis "Did we(b development) lose the right direction?"
PDF
Web app and more
PDF
Web Apps and more
PDF
Look ma! No images!
PDF
Even faster web sites
PDF
Now you see me... Adaptive Web Design and Development
PDF
Disruptive code
PPTX
Web Directions South - Even Faster Web Sites
PPTX
Chapter15-Presentation.pptx
PDF
A practical guide to building websites with HTML5 & CSS3
PDF
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
PDF
From Hacker to Programmer (w/ Webpack, Babel and React)
HTML5 Who what where when why how
JavaScript performance patterns
Build Your Own CMS with Apache Sling
10 Web Performance Lessons For the 21st Century
SPSDenver - SharePoint & jQuery - What I wish I would have known
JavaScript Performance Patterns
Developing web applications in 2010
Introduction to jQuery
Stefan Judis "Did we(b development) lose the right direction?"
Web app and more
Web Apps and more
Look ma! No images!
Even faster web sites
Now you see me... Adaptive Web Design and Development
Disruptive code
Web Directions South - Even Faster Web Sites
Chapter15-Presentation.pptx
A practical guide to building websites with HTML5 & CSS3
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
From Hacker to Programmer (w/ Webpack, Babel and React)
Ad

More from Kirill Borzov (9)

PPTX
Учимся Руководить
PDF
UX for Busy People
PPTX
Lets talk about JavaScript (at JSMD Meetup #7)
PDF
Timber Wordpress presentation
PPTX
Panels: how to fire Front-end developer
PPTX
Drupal 7 — Circle theme
PPTX
Theming in Drupal 8 (everything)
PPTX
RailsGirls Mixbook presentation
PPTX
Рекрутинг.Js
Учимся Руководить
UX for Busy People
Lets talk about JavaScript (at JSMD Meetup #7)
Timber Wordpress presentation
Panels: how to fire Front-end developer
Drupal 7 — Circle theme
Theming in Drupal 8 (everything)
RailsGirls Mixbook presentation
Рекрутинг.Js
Ad

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
cuic standard and advanced reporting.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Approach and Philosophy of On baking technology
Understanding_Digital_Forensics_Presentation.pptx
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
cuic standard and advanced reporting.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Weekly Chronicles - August'25 Week I
MYSQL Presentation for SQL database connectivity
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Reach Out and Touch Someone: Haptics and Empathic Computing
Digital-Transformation-Roadmap-for-Companies.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf

Mobile and web optimization + Drupal