SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Frontend Challenges
     @Flipkart
     -Aakash Bapna
Flipkart frontend - overview
● >4M pageviews a day.

● Browser share- 40% Chrome, 26% FF,
  20% IE.

● In house CDN to serve static files

● PHP for frontend, jQuery and friends for
  clientside.
Challenges we face
●   Secure cross domain calls.
●   Static content.
●   Webfonts.
●   Scalable CSS code.
●   Cleaning up old code.
Cross domain transport
     with iframes
Lightweight, very fast and cross browser
Requirements
●   Do POST requests between http and https.
●   Cross browser- IE6+, Chrome, FF.
●   Fast, lightweight.
●   Transfer megabytes of data easily.
window.postMessage()
  IE 8+, FF 3.6+, Chrome 1.0+
window.postMessage()
   IE 8+, FF 3.6+, Chrome 1.0+



      window.name
IE 6-7 and other old school browsers
window.name
● Allows us to send loads of data (~2mb)
  between frames.
● Doesn't require a proxy iframe.
● Full async, no polling anywhere.
window.name

<script>
    var message = <?php echo json_encode(json_encode($arr));?>;
     if (typeof top.postMessage != "undefined") {
         top.postMessage(message, "http://www.flipkart.com");
     } else {
         window.name = message; //FOR IE7/IE6
         window.location.href = 'http://www.flipkart.com/favicon.ico';
     }
</script>
One small thing...
we messed up with the back button.
In house CDN
no packet goes out of India!
Highlights
● Runtime switching of static servers by
  config.
● Fallback to alternative CDN when traffic
  spikes.
● High Latency, cost effective.
● Other CDN's geo-mapping screws up with
  GooglePublicDNS/OpenDNS.
● Lessons learnt help us in tuning the overall
  network stack.
Webfonts
 not so easy!
Gotchas
1. Subset the font. Adjust x-height. use-
   fontsquirrel.com
2. IE doesn’t render anything in the page until
   the font file is done downloading if there is a
   SCRIPT tag above the @font-face
   declaration.
3. Chrome, FF download the font file only when
   they encounter text using the font. The text
   is hidden while the font is downloading.
We ♥ OCSS
  CSS is art!
OCSS in brief
● Separate structure and skin.
● Separate container and content.
● Results in highly reusable(but non-
  semantic!) CSS classes.
● Selectors - CSS architecture.

● Against most CSS best practices.
OCSS grids (css)
line, .lastUnit {overflow: hidden; _overflow:visible;
_zoom:1;}
.unit {float: left; _zoom:1;}
.unitExt {float: right;}
.size1of1 {float: none;}
.size1of2 {width: 50%;}
.size1of3 {width: 33.3333%;}
.size2of3 {width: 66.6667%;}
.size1of4 {width: 25%;}
.size3of4 {width: 75%;}
.lastUnit {float: none; _position:relative; _left:-3px;
_margin-right: -3px;width:auto;}
OCSS grids (markup)
  <div class="unit size1of2">
       <div class="unit size1of3">
           <p>Lorem</p>
       </div>
       <div class="unit size1of3">
           <p>Ipsum</p>
       </div>
   </div>
   <div class="unit size1of2">
       <div class="unit size1of4">
           <p>Lorem</p>
       </div>
       <div class="unit size3of4">
           <p>Ipsum</p>
       </div>
   </div>
OCSS examples
.fk-font-small {
   font-size:11px;
}
.fk-font-normal {
   font-size:13px;
}
.fk-font-big {
   font-size:16px;
 }

.rpadding5 {
   padding-right:5px;
}
CSS bloat
Its unavoidable, tedious to cleanup.
Why bloat?
1. Bad code- override, overrides & overrides.
2. Stale, unused selectors.
Redundant declarations
● text-decoration:underline
● text-decoration:none

● margin:0 padding:0 border:0

●   width:100%
●   display:block
●   cursor:pointer
●   font-weight:bold
CSS cleanup tool (Experimental)
● Runs on Nodejs.
● Fetchs pages, simulates a browser with
  JSDom and Sizzle.
● Parses given CSS file(s).
● Tests for presence of selector in pages with
  document.querySelector().
● Rewrites CSS file marking unused selectors
  in comments.
Questions?
Thank you
mail: aakash@flipkart.com
    twitter: @_aakash

Weitere ähnliche Inhalte

Was ist angesagt?

Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQRest West
 
BP101: A Modernized Workflow w/ Domino/XPages
BP101: A Modernized Workflow w/ Domino/XPagesBP101: A Modernized Workflow w/ Domino/XPages
BP101: A Modernized Workflow w/ Domino/XPagesedm00se
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performaceTuyển Đoàn
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonNeotys
 
WordPress Optimization with Litespeed Cache #wpjkt14
WordPress Optimization with Litespeed Cache  #wpjkt14WordPress Optimization with Litespeed Cache  #wpjkt14
WordPress Optimization with Litespeed Cache #wpjkt14WordPress
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPChau Thanh
 
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionTekno Point
 
Measuring Web Performance
Measuring Web Performance Measuring Web Performance
Measuring Web Performance Dave Olsen
 
WordPress + NGINX Best Practices with EasyEngine
WordPress + NGINX Best Practices with EasyEngineWordPress + NGINX Best Practices with EasyEngine
WordPress + NGINX Best Practices with EasyEngineNGINX, Inc.
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017ElifTech
 
Architectures For Scaling Ajax
Architectures For Scaling AjaxArchitectures For Scaling Ajax
Architectures For Scaling Ajaxwolframkriesing
 
Host, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsHost, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsJose Javier Columbie
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ XeroCraig Walker
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Alan Lok
 
UXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXUXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXStoian Dipchikov
 
Webpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsGrgur Grisogono
 
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
 
3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress Performance3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress PerformanceRF Studio
 
Chrome Extension Develop Starts
Chrome Extension Develop StartsChrome Extension Develop Starts
Chrome Extension Develop Startstaobao.com
 

Was ist angesagt? (20)

Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQ
 
BP101: A Modernized Workflow w/ Domino/XPages
BP101: A Modernized Workflow w/ Domino/XPagesBP101: A Modernized Workflow w/ Domino/XPages
BP101: A Modernized Workflow w/ Domino/XPages
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performace
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark Tomlinson
 
WordPress Optimization with Litespeed Cache #wpjkt14
WordPress Optimization with Litespeed Cache  #wpjkt14WordPress Optimization with Litespeed Cache  #wpjkt14
WordPress Optimization with Litespeed Cache #wpjkt14
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHP
 
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - Introduction
 
Measuring Web Performance
Measuring Web Performance Measuring Web Performance
Measuring Web Performance
 
WordPress + NGINX Best Practices with EasyEngine
WordPress + NGINX Best Practices with EasyEngineWordPress + NGINX Best Practices with EasyEngine
WordPress + NGINX Best Practices with EasyEngine
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017
 
Architectures For Scaling Ajax
Architectures For Scaling AjaxArchitectures For Scaling Ajax
Architectures For Scaling Ajax
 
Host, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsHost, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server Apps
 
Web performance
Web performanceWeb performance
Web performance
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015
 
UXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXUXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UX
 
Webpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ Steps
 
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...
 
3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress Performance3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress Performance
 
Chrome Extension Develop Starts
Chrome Extension Develop StartsChrome Extension Develop Starts
Chrome Extension Develop Starts
 

Andere mochten auch

Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7While42
 
Flipkart Vs Amazon- A Case Study on e retailing.
Flipkart Vs Amazon- A Case Study on e retailing.Flipkart Vs Amazon- A Case Study on e retailing.
Flipkart Vs Amazon- A Case Study on e retailing.Sumit Lokhande
 
The power of creative collaboration
The power of creative collaborationThe power of creative collaboration
The power of creative collaborationTable19
 
Digital Marketing Trends 2015
Digital Marketing Trends 2015Digital Marketing Trends 2015
Digital Marketing Trends 2015Dave Chaffey
 

Andere mochten auch (6)

Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
 
Marketing Trends 2017 Part 1 of 2
Marketing Trends 2017 Part 1 of 2Marketing Trends 2017 Part 1 of 2
Marketing Trends 2017 Part 1 of 2
 
Flipkart success story
Flipkart success storyFlipkart success story
Flipkart success story
 
Flipkart Vs Amazon- A Case Study on e retailing.
Flipkart Vs Amazon- A Case Study on e retailing.Flipkart Vs Amazon- A Case Study on e retailing.
Flipkart Vs Amazon- A Case Study on e retailing.
 
The power of creative collaboration
The power of creative collaborationThe power of creative collaboration
The power of creative collaboration
 
Digital Marketing Trends 2015
Digital Marketing Trends 2015Digital Marketing Trends 2015
Digital Marketing Trends 2015
 

Ähnlich wie Metarefresh

Web Fundamentals Crash Course
Web Fundamentals Crash CourseWeb Fundamentals Crash Course
Web Fundamentals Crash CourseMrAbbas
 
Web Fundamentals Crash Course
Web Fundamentals Crash CourseWeb Fundamentals Crash Course
Web Fundamentals Crash CourseMrAbas
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pagesNilesh Bafna
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performanceAndrew Siemer
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on SteroidsSiteGround.com
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web AppsTimothy Fisher
 
Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"Fwdays
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsSiarhei Barysiuk
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)Igalia
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend PerformanceThomas Weinert
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalabilityTwinbit
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukgareth53
 
Extreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile DevicesExtreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile DevicesMaximiliano Firtman
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testingRoman Ananev
 
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)Adam Dunford
 
Word press optimizations
Word press optimizations Word press optimizations
Word press optimizations Shawn DeWolfe
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibrePablo Moretti
 
Progressive enhancement
Progressive enhancementProgressive enhancement
Progressive enhancementZohar Arad
 

Ähnlich wie Metarefresh (20)

Web Fundamentals Crash Course
Web Fundamentals Crash CourseWeb Fundamentals Crash Course
Web Fundamentals Crash Course
 
Web Fundamentals Crash Course
Web Fundamentals Crash CourseWeb Fundamentals Crash Course
Web Fundamentals Crash Course
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web Apps
 
Into The Box 2018 Ortus Keynote
Into The Box 2018 Ortus KeynoteInto The Box 2018 Ortus Keynote
Into The Box 2018 Ortus Keynote
 
Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend Performance
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalability
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.uk
 
Extreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile DevicesExtreme Web Performance for Mobile Devices
Extreme Web Performance for Mobile Devices
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing
 
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
 
Word press optimizations
Word press optimizations Word press optimizations
Word press optimizations
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre
 
Progressive enhancement
Progressive enhancementProgressive enhancement
Progressive enhancement
 
Break out of The Box - Part 2
Break out of The Box - Part 2Break out of The Box - Part 2
Break out of The Box - Part 2
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Metarefresh

  • 1. Frontend Challenges @Flipkart -Aakash Bapna
  • 2. Flipkart frontend - overview ● >4M pageviews a day. ● Browser share- 40% Chrome, 26% FF, 20% IE. ● In house CDN to serve static files ● PHP for frontend, jQuery and friends for clientside.
  • 3. Challenges we face ● Secure cross domain calls. ● Static content. ● Webfonts. ● Scalable CSS code. ● Cleaning up old code.
  • 4. Cross domain transport with iframes Lightweight, very fast and cross browser
  • 5. Requirements ● Do POST requests between http and https. ● Cross browser- IE6+, Chrome, FF. ● Fast, lightweight. ● Transfer megabytes of data easily.
  • 6. window.postMessage() IE 8+, FF 3.6+, Chrome 1.0+
  • 7. window.postMessage() IE 8+, FF 3.6+, Chrome 1.0+ window.name IE 6-7 and other old school browsers
  • 8. window.name ● Allows us to send loads of data (~2mb) between frames. ● Doesn't require a proxy iframe. ● Full async, no polling anywhere.
  • 9. window.name <script> var message = <?php echo json_encode(json_encode($arr));?>; if (typeof top.postMessage != "undefined") { top.postMessage(message, "http://www.flipkart.com"); } else { window.name = message; //FOR IE7/IE6 window.location.href = 'http://www.flipkart.com/favicon.ico'; } </script>
  • 10. One small thing... we messed up with the back button.
  • 11. In house CDN no packet goes out of India!
  • 12. Highlights ● Runtime switching of static servers by config. ● Fallback to alternative CDN when traffic spikes. ● High Latency, cost effective. ● Other CDN's geo-mapping screws up with GooglePublicDNS/OpenDNS. ● Lessons learnt help us in tuning the overall network stack.
  • 14. Gotchas 1. Subset the font. Adjust x-height. use- fontsquirrel.com 2. IE doesn’t render anything in the page until the font file is done downloading if there is a SCRIPT tag above the @font-face declaration. 3. Chrome, FF download the font file only when they encounter text using the font. The text is hidden while the font is downloading.
  • 15. We ♥ OCSS CSS is art!
  • 16. OCSS in brief ● Separate structure and skin. ● Separate container and content. ● Results in highly reusable(but non- semantic!) CSS classes. ● Selectors - CSS architecture. ● Against most CSS best practices.
  • 17. OCSS grids (css) line, .lastUnit {overflow: hidden; _overflow:visible; _zoom:1;} .unit {float: left; _zoom:1;} .unitExt {float: right;} .size1of1 {float: none;} .size1of2 {width: 50%;} .size1of3 {width: 33.3333%;} .size2of3 {width: 66.6667%;} .size1of4 {width: 25%;} .size3of4 {width: 75%;} .lastUnit {float: none; _position:relative; _left:-3px; _margin-right: -3px;width:auto;}
  • 18. OCSS grids (markup) <div class="unit size1of2"> <div class="unit size1of3"> <p>Lorem</p> </div> <div class="unit size1of3"> <p>Ipsum</p> </div> </div> <div class="unit size1of2"> <div class="unit size1of4"> <p>Lorem</p> </div> <div class="unit size3of4"> <p>Ipsum</p> </div> </div>
  • 19. OCSS examples .fk-font-small { font-size:11px; } .fk-font-normal { font-size:13px; } .fk-font-big { font-size:16px; } .rpadding5 { padding-right:5px; }
  • 20. CSS bloat Its unavoidable, tedious to cleanup.
  • 21. Why bloat? 1. Bad code- override, overrides & overrides. 2. Stale, unused selectors.
  • 22. Redundant declarations ● text-decoration:underline ● text-decoration:none ● margin:0 padding:0 border:0 ● width:100% ● display:block ● cursor:pointer ● font-weight:bold
  • 23. CSS cleanup tool (Experimental) ● Runs on Nodejs. ● Fetchs pages, simulates a browser with JSDom and Sizzle. ● Parses given CSS file(s). ● Tests for presence of selector in pages with document.querySelector(). ● Rewrites CSS file marking unused selectors in comments.