SlideShare uma empresa Scribd logo
1 de 26
Website Optimization with
    RequestReduce
    Matt Wrock 10/26/2011
Current Trends in Web Page Size And
             Request Counts




From http://httparchive.org
Web Performance Predictors




From http://httparchive.org
Why is this important?
• PLT has a direct impact on traffic and
  conversions
• Yahoo found that 400ms equaled a 5 – 9%
  drop in full page traffic
• Google takes speed into account in search
  rankings
What is RequestReduce
• Applies common client side performance best
  practices so that you don’t have to
  – CSS and Javascript Merge and Minification
  – CSS Import expansion
  – Automatic Sprite Generation
  – Sprite PNG Optimization
  – Cache Header Generation
  – Supports multi server content synchronization
  – Supports CDN hosts
Side by Side Comparison
        (Without RequestReduce)
Side by Side Comparison
        (With RequestReduce)
The Competition
Features Unique to RequestReduce
• Reduces on the fly instead of at build time
  – Can reduce Dynamic css and javascript
• Unobtrusive: Does not require you to change
  your code, configuration or file structure.
• Works with all asp.net technologies
  (MVC/Web Forms/Razor)
• Pulls resources via HTTP – can reduce
  distributed and third party resources.
• Synchronizes content across multiple servers
Why not just make this part of the
            build process?
• Does not work or difficult to integrate with
  dynamic or external css and javascript
• Unusually requires new static resource to be
  manually “plugged in”
• Easy to forget or overlook integrating new
  content
• RequestReduce is designed to be “dropped” in to
  any running app with minimal customization or
  consideration of that App’s design
RequestReduce: How does it work?
• Filter’s the response looking for <HEAD/> and <SCRIPT/> tags
   – Derives from Stream and is attached to the Response stream of any
       text/html resource
   – Extracts URLs from Link hrefs and script src
   – Ignore CSS and Script inside conditional comments
   – Ignore script URLs included in black list (google and MS jquery CDN
       included by default)
   – Creates a key from concatenated urls that can be merged together
   – Queries a dictionary for the existence of that key
The Reducing Process
Sprite Generation

• All CSS is scanned for classes containing a
  background image.
• Each class is treated as an autonomous unit. No
  inheritance awareness.
• Cannot currently sprite:
  – Repeating images
  – Images positioned with non pixel units or a
    percentage unit > 0.
  – Images with no explicit horizontal dimension (padding
    + width)
Sprite Image Processing
• Both Lossy and Lossless compression is applied.
• Silverlight Code Gallery before any spriting is
  applied has a spritable payload size of 18k.
• After initial sprite generation: 27k

• Why? It’s a 32bit PNG
• Need to quantize down to 8 bit.
• Standard C based quantizers had inadequate
  quality
Developing nQuant
• Images quantized using pngquant.exe were often coming
  out with distorted colors

• Tried to find Free OSS quantizers. Either license was not
  friendly or the they were code samples that were not alpha
  aware and had horrid quality.
• Found a C based algorithm converted to C# that was
  extremely high quality but not alpha aware.
• Tokk me about a month to come up with the formulas that
  supported the alpha layers and the result is nQuant
  (available on codeplex).
• Silverlight spright optimized to 10.6k after quantization.
• Use optipng for final lossless compression to get to 9k.
Sprite Sizing Limits
• RequestReduce continues to add images to a
  sprite until the image size exceeds 50k.
• OR until there are over 5000 unique colors in
  the sprite – Mitigates poor quantization
  output.
• Threshold can be safely increased with JPGs.
• Lots of room for future experimantation here
Migration issues with sprites
• Depending on original CSS structure, can
  sprite most images with no editing or
  dramatically distort the rendering.
• Like every thing else, this feature can be
  turned off.
• I have assisted Galleries, Forums, Profile and
  Search to convert the CSS to be
  RequestReduce friendly.
CSS Sprite change example
• Old CSS:
img.alert,
img.answer,
img.answered,
img.ask
{ background: url('http://i1.social.s-msft.com/contentservice/c2afadb0-5d34-489a-bf31-
9f5c011d3cd4/icon_strip_windows.png') no-repeat !important;
Width: 20px;}

img.ask { background-position: -100px 0;}

img.answer { background-position: -120px 0;}

img.alert { background-position: -140px 0;}


• Merge image with position into one class.
Serving the Reduced Resources
• All reduced content is cached and managed by
  RequestReduce
• The following caching headers are applied:
  – Cache-control: public (ensures resources will be
    cached on proxies and CDNs)
  – Expires: 360 days from serving (over a year would
    violate http RFC)
  – Etag: “<32byte hash of file contents>” ensures
    Etag is automatically invalidated upon content
    change.
Reduced Content caching

• RequestReduce Supports two caching modes:
  – Simple file system cache
     • This can be any UNC path including a remote share or
       centralized image server
     • This mode is ideal for individual dev environments due
       to its simplicity.
     • On app startup, the file names of the file cache are read
       and keyed in memory so that content does not have to
       be reprocessed.
  – SQL Server caching…
Caching across multiple servers
• The Sql Server based cache is ideal for multi
  server test and production environments.
• All reduced content is initially saved to a sql
  table
Content Changing and Flushing
• Content is automatically flushed and queued for
  reprocessing when CSS or Javascript Urls change.
• Changes that do not result in a url change will require a
  flush in order to be seen. To flush content from a file
  based settingm you can wither delete the
  RequestReduce directory or issue a flush explicitly via
  http://<app>/RequestReduceContent/flush
• Sql Servers can also call the flush url but it may take up
  to 5 minutes for all servers to sync.
• Deleting the data directory in a webserver running
  against a sql based cache, will NOT clear the cache.
Troubleshooting
• Normal dev work may want to have
  RequestReduce turned off.
• Appending any url with rrfilter=disabled
  effectively shuts down the response filter for
  the current request. This is a good technique
  to determine if RequestReduce is responsible
  for page defects
Optimizing
• Request can often perform better based on
  dev practices:
  – Maker sure background images are sprite friendly
  – Use background images for commonly used
    foreground images
  – Group cachable javascript together and preferably
    at the bottom of the page if you can
So many more possibilities
• Foreground image spriting
• Optimize non sprites
• Externalize inline styles and scripts
• Asynchronously load CSS
• Support defered javascript execution
• Exploit perf optimizations specific to the browser
  of the incoming request
• Make the processing build friendly and expand
  extension points
Resources
• Project home page: http://www.RequestReduce.com
• Source Code:
  https://github.com/mwrock/RequestReduce I take
  pull requests
• Detailed and organized Wiki documentation:
  https://github.com/mwrock/RequestReduce/wiki
• Bug reporting and feature requests:
  https://github.com/mwrock/RequestReduce/issue

Mais conteúdo relacionado

Mais procurados

DB multi tenancy with Rails 6
DB multi tenancy with Rails 6DB multi tenancy with Rails 6
DB multi tenancy with Rails 6João Fernandes
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best PracticesRatnesh kumar, CSM
 
Shootout! Template engines for the JVM
Shootout! Template engines for the JVMShootout! Template engines for the JVM
Shootout! Template engines for the JVMJeroen Reijn
 
Best practices para publicar un WebSite con SharePoint Server 2010
Best practices para publicar un WebSite con SharePoint Server 2010Best practices para publicar un WebSite con SharePoint Server 2010
Best practices para publicar un WebSite con SharePoint Server 2010Juan Andrés Valenzuela
 
Introduction to CosmosDB - Azure Bootcamp 2018
Introduction to CosmosDB - Azure Bootcamp 2018Introduction to CosmosDB - Azure Bootcamp 2018
Introduction to CosmosDB - Azure Bootcamp 2018Josh Carlisle
 
pranayJ
pranayJpranayJ
pranayJPray B
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraKishore Chandra
 
WordPress at Scale Webinar
WordPress at Scale WebinarWordPress at Scale Webinar
WordPress at Scale WebinarPantheon
 
Webpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need itWebpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need itMike Wilcox
 
Tridion Content Broker - how and why we are using it at the RSPB (2007)
Tridion Content Broker - how and why we are using it at the RSPB (2007)Tridion Content Broker - how and why we are using it at the RSPB (2007)
Tridion Content Broker - how and why we are using it at the RSPB (2007)Graham Bird
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoSencha
 
About Caching
About CachingAbout Caching
About CachingWeng Wei
 
Drupal Performance Audit and Optimization
Drupal Performance Audit and OptimizationDrupal Performance Audit and Optimization
Drupal Performance Audit and OptimizationZyxware Technologies
 
Where do I put this data? #lessql
Where do I put this data? #lessqlWhere do I put this data? #lessql
Where do I put this data? #lessqlEzra Zygmuntowicz
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Amazee Labs
 
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDBZapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDBOren Eini
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeRadosław Scheibinger
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedAndy Kucharski
 

Mais procurados (20)

DB multi tenancy with Rails 6
DB multi tenancy with Rails 6DB multi tenancy with Rails 6
DB multi tenancy with Rails 6
 
Mean stack
Mean stackMean stack
Mean stack
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
 
Shootout! Template engines for the JVM
Shootout! Template engines for the JVMShootout! Template engines for the JVM
Shootout! Template engines for the JVM
 
Best practices para publicar un WebSite con SharePoint Server 2010
Best practices para publicar un WebSite con SharePoint Server 2010Best practices para publicar un WebSite con SharePoint Server 2010
Best practices para publicar un WebSite con SharePoint Server 2010
 
Introduction to CosmosDB - Azure Bootcamp 2018
Introduction to CosmosDB - Azure Bootcamp 2018Introduction to CosmosDB - Azure Bootcamp 2018
Introduction to CosmosDB - Azure Bootcamp 2018
 
pranayJ
pranayJpranayJ
pranayJ
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore Chandra
 
WordPress at Scale Webinar
WordPress at Scale WebinarWordPress at Scale Webinar
WordPress at Scale Webinar
 
Webpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need itWebpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need it
 
Tridion Content Broker - how and why we are using it at the RSPB (2007)
Tridion Content Broker - how and why we are using it at the RSPB (2007)Tridion Content Broker - how and why we are using it at the RSPB (2007)
Tridion Content Broker - how and why we are using it at the RSPB (2007)
 
Dangerous CSS
Dangerous CSSDangerous CSS
Dangerous CSS
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff Stano
 
About Caching
About CachingAbout Caching
About Caching
 
Drupal Performance Audit and Optimization
Drupal Performance Audit and OptimizationDrupal Performance Audit and Optimization
Drupal Performance Audit and Optimization
 
Where do I put this data? #lessql
Where do I put this data? #lessqlWhere do I put this data? #lessql
Where do I put this data? #lessql
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012
 
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDBZapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 

Semelhante a Website optimization with request reduce

DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtNick Santamaria
 
Enterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and RedundancyEnterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and RedundancyJohn Giaconia
 
How_To_Soup_Up_Your_Farm
How_To_Soup_Up_Your_FarmHow_To_Soup_Up_Your_Farm
How_To_Soup_Up_Your_FarmNigel Price
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 
Best practices-wordpress-enterprise
Best practices-wordpress-enterpriseBest practices-wordpress-enterprise
Best practices-wordpress-enterpriseTaylor Lovett
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseTaylor Lovett
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonPhil Pursglove
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPressTaylor Lovett
 
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7Phil Pursglove
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsTaylor Lovett
 
ASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDPhil Pursglove
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance OptimizationChen-Tien Tsai
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your WebsiteAcquia
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Dimitri de Putte
 
Website Performance
Website PerformanceWebsite Performance
Website PerformanceHugo Fonseca
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101FITC
 

Semelhante a Website optimization with request reduce (20)

DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an Afterthought
 
Enterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and RedundancyEnterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and Redundancy
 
How_To_Soup_Up_Your_Farm
How_To_Soup_Up_Your_FarmHow_To_Soup_Up_Your_Farm
How_To_Soup_Up_Your_Farm
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
High performance website
High performance websiteHigh performance website
High performance website
 
Salesforce Performance hacks - Client Side
Salesforce Performance hacks - Client SideSalesforce Performance hacks - Client Side
Salesforce Performance hacks - Client Side
 
Best practices-wordpress-enterprise
Best practices-wordpress-enterpriseBest practices-wordpress-enterprise
Best practices-wordpress-enterprise
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG London
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
 
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
ASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDASP.NET Scalability - WebDD
ASP.NET Scalability - WebDD
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101
 

Último

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Último (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Website optimization with request reduce

  • 1. Website Optimization with RequestReduce Matt Wrock 10/26/2011
  • 2. Current Trends in Web Page Size And Request Counts From http://httparchive.org
  • 3. Web Performance Predictors From http://httparchive.org
  • 4. Why is this important? • PLT has a direct impact on traffic and conversions • Yahoo found that 400ms equaled a 5 – 9% drop in full page traffic • Google takes speed into account in search rankings
  • 5. What is RequestReduce • Applies common client side performance best practices so that you don’t have to – CSS and Javascript Merge and Minification – CSS Import expansion – Automatic Sprite Generation – Sprite PNG Optimization – Cache Header Generation – Supports multi server content synchronization – Supports CDN hosts
  • 6. Side by Side Comparison (Without RequestReduce)
  • 7. Side by Side Comparison (With RequestReduce)
  • 9. Features Unique to RequestReduce • Reduces on the fly instead of at build time – Can reduce Dynamic css and javascript • Unobtrusive: Does not require you to change your code, configuration or file structure. • Works with all asp.net technologies (MVC/Web Forms/Razor) • Pulls resources via HTTP – can reduce distributed and third party resources. • Synchronizes content across multiple servers
  • 10. Why not just make this part of the build process? • Does not work or difficult to integrate with dynamic or external css and javascript • Unusually requires new static resource to be manually “plugged in” • Easy to forget or overlook integrating new content • RequestReduce is designed to be “dropped” in to any running app with minimal customization or consideration of that App’s design
  • 11. RequestReduce: How does it work? • Filter’s the response looking for <HEAD/> and <SCRIPT/> tags – Derives from Stream and is attached to the Response stream of any text/html resource – Extracts URLs from Link hrefs and script src – Ignore CSS and Script inside conditional comments – Ignore script URLs included in black list (google and MS jquery CDN included by default) – Creates a key from concatenated urls that can be merged together – Queries a dictionary for the existence of that key
  • 13. Sprite Generation • All CSS is scanned for classes containing a background image. • Each class is treated as an autonomous unit. No inheritance awareness. • Cannot currently sprite: – Repeating images – Images positioned with non pixel units or a percentage unit > 0. – Images with no explicit horizontal dimension (padding + width)
  • 14. Sprite Image Processing • Both Lossy and Lossless compression is applied. • Silverlight Code Gallery before any spriting is applied has a spritable payload size of 18k. • After initial sprite generation: 27k • Why? It’s a 32bit PNG • Need to quantize down to 8 bit. • Standard C based quantizers had inadequate quality
  • 15. Developing nQuant • Images quantized using pngquant.exe were often coming out with distorted colors • Tried to find Free OSS quantizers. Either license was not friendly or the they were code samples that were not alpha aware and had horrid quality. • Found a C based algorithm converted to C# that was extremely high quality but not alpha aware. • Tokk me about a month to come up with the formulas that supported the alpha layers and the result is nQuant (available on codeplex). • Silverlight spright optimized to 10.6k after quantization. • Use optipng for final lossless compression to get to 9k.
  • 16. Sprite Sizing Limits • RequestReduce continues to add images to a sprite until the image size exceeds 50k. • OR until there are over 5000 unique colors in the sprite – Mitigates poor quantization output. • Threshold can be safely increased with JPGs. • Lots of room for future experimantation here
  • 17. Migration issues with sprites • Depending on original CSS structure, can sprite most images with no editing or dramatically distort the rendering. • Like every thing else, this feature can be turned off. • I have assisted Galleries, Forums, Profile and Search to convert the CSS to be RequestReduce friendly.
  • 18. CSS Sprite change example • Old CSS: img.alert, img.answer, img.answered, img.ask { background: url('http://i1.social.s-msft.com/contentservice/c2afadb0-5d34-489a-bf31- 9f5c011d3cd4/icon_strip_windows.png') no-repeat !important; Width: 20px;} img.ask { background-position: -100px 0;} img.answer { background-position: -120px 0;} img.alert { background-position: -140px 0;} • Merge image with position into one class.
  • 19. Serving the Reduced Resources • All reduced content is cached and managed by RequestReduce • The following caching headers are applied: – Cache-control: public (ensures resources will be cached on proxies and CDNs) – Expires: 360 days from serving (over a year would violate http RFC) – Etag: “<32byte hash of file contents>” ensures Etag is automatically invalidated upon content change.
  • 20. Reduced Content caching • RequestReduce Supports two caching modes: – Simple file system cache • This can be any UNC path including a remote share or centralized image server • This mode is ideal for individual dev environments due to its simplicity. • On app startup, the file names of the file cache are read and keyed in memory so that content does not have to be reprocessed. – SQL Server caching…
  • 21. Caching across multiple servers • The Sql Server based cache is ideal for multi server test and production environments. • All reduced content is initially saved to a sql table
  • 22. Content Changing and Flushing • Content is automatically flushed and queued for reprocessing when CSS or Javascript Urls change. • Changes that do not result in a url change will require a flush in order to be seen. To flush content from a file based settingm you can wither delete the RequestReduce directory or issue a flush explicitly via http://<app>/RequestReduceContent/flush • Sql Servers can also call the flush url but it may take up to 5 minutes for all servers to sync. • Deleting the data directory in a webserver running against a sql based cache, will NOT clear the cache.
  • 23. Troubleshooting • Normal dev work may want to have RequestReduce turned off. • Appending any url with rrfilter=disabled effectively shuts down the response filter for the current request. This is a good technique to determine if RequestReduce is responsible for page defects
  • 24. Optimizing • Request can often perform better based on dev practices: – Maker sure background images are sprite friendly – Use background images for commonly used foreground images – Group cachable javascript together and preferably at the bottom of the page if you can
  • 25. So many more possibilities • Foreground image spriting • Optimize non sprites • Externalize inline styles and scripts • Asynchronously load CSS • Support defered javascript execution • Exploit perf optimizations specific to the browser of the incoming request • Make the processing build friendly and expand extension points
  • 26. Resources • Project home page: http://www.RequestReduce.com • Source Code: https://github.com/mwrock/RequestReduce I take pull requests • Detailed and organized Wiki documentation: https://github.com/mwrock/RequestReduce/wiki • Bug reporting and feature requests: https://github.com/mwrock/RequestReduce/issue