SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
Improving Site Response Time
                          Part 1: Front-End Optimization (FEO)




Kim Stefan Lindholm                        1                     26.1.2012
SETUP
•   Server: CloudControl (Dublin, Ireland) with local Varnish HTTP accelerator

•   CMS (Content Management System): Joomla 1.5

•   WAF (Web Application Firewall): Incapsula

•   CDN (Content Delivery Network): Akamai (Rackspace) & Amazon CloudFront

•   Anycast DNS: DNS Made Easy



    NB: Incapsula and Akamai automatically serve compressed (gzip) files
                                              2
RESULTS
                                                                   Proxy servers may take some time
                                                                    to refresh their cache, which can
                                                                    delay performance improvement.


               Browser & server
             cache + compression
                                       Minify images,
                                         CSS & JS       Combine
Gzip HTML,                                              CSS & JS
                                                                     Inline images,
No caching
                                                                    Pre-gzip, CDN




               Main page, average response time (ms)
                                                3                                 Pingdom Panel, global average
LOAD TIME
18 s


14 s

                                                              Original
 9s                                                           Caching
                                                              CloudFront, inline, gzip

 5s



       Amsterdam   Dallas, TX   Dulles, VA   Jiangsu, China



                                   4
LOAD TIME

         Amsterdam        Dallas, TX
Chrome                                 Chrome
             -87%             -69%

         Dulles, VA       Jiangsu
 IE 8                                   IE 7
             -51%             -64%


                      5
How much were we able to decrease
     costly HTTP requests?



                6
CACHED VS. FINAL

               HTTP Requests
                   -83%

               Total Weight
                   -30%

                   Original total weight
                          was 206K


       7           Yahoo YSlow add-on for Chrome
Did Incapsula web proxy/firewall
   contribute to the results?



               8
INCAPSULA




Incapsula caching seemed to be affected by incoming traffic (site popularity)
     and not so much by changes in the website itself (cacheability etc.)


                                     9
Speed difference between Incapsula
proxy and global CDN (measured in
             Europe)?


                10
PROXY VS. CDN
   Average load speed (real) tested with 10 iterations: time curl [--compressed] <url> > /dev/null


2,500 ms


1,875 ms
                                                                                               No proxy
                                                                                               Incapsula
                                                                                               Incapsula, gzip
1,250 ms                         Compressed                                                    Akamai
                                  size: 34k
                                                         Compressed                            Akamai, gzip
                                                           size: 3k        Slowest 1st load:
                                                                               1400 ms
 625 ms



            mootools.js (116k)          template.css (11k)     template_ie7.css (2k)

                                                        11
PROXY VS. CDN

• Standarddeviation with Akamai CDN was notable. At worst, fetching a 2k
 file was 3x slower than with the original unproxied connection.

• Withcompression on, first loads seemed very slow. This is acceptable, of
 course, if gzipping and pushing to cache only happens infrequently.

• Given the additional overhead of compression and DNS lookups, small files
 (<10k) are not automatically perfect candidates for CDN. Combine images
 using sprites instead.

                                     12
Speed difference between Akamai and
        Amazon CloudFront?



                 13
CDN COMPARISON




Akamai, gzip        CloudFront, gzip



               14              Pingdom Panel, Response time report
CDN COMPARISON
        Main page first load speed, CDN allowed to propagate for one day


9s


7s
                                                                          Akamai, gzip
                                                                          CloudFront
                                                                          CloudFront, gzip
5s


2s



     Amsterdam    Dallas    Los Angeles        Singapore   Tokyo

                                          15
CDN COMPARISON
      Main page second load speed, CDN allowed to propagate for one day


9s


7s
                                                                          Akamai, gzip
                                                                          CloudFront
                                                                          CloudFront, gzip
5s


2s

                                                                    CDNs seem quite equal
                                                                          in performance.
     Amsterdam   Dallas    Los Angeles        Singapore   Tokyo

                                         16
RE
                                                                                 VIS
                                PROXY VS. CDN                                          ITE
                                                                                          D

Average load speed (real) tested with 3 iterations: time curl --compressed <url> > /dev/null

       File: css-main-data.gz.css (73k)             Transparent bar denotes 1st load
13 s

10 s
                                                                                              Incapsula, gzip
 8s                                                                                           Akamai, gzip
                                                                                              CloudFront, gzip

 5s

 3s
                                                                                              Akamai was the
                                                                                          steadiest performer
              Norway                      UK   US                    Japan                       globally.


                                               17
LEARNINGS
• CDN    for large files and gzipping are always good for performance

• CDN    for small files can actually slow down performance

• Parallelizing   across hosts works fine (2-4 hosts recommended by Yahoo)

• Options  for gzipping CSS & JS: (1) Pre-compress and serve the right
 version (fastest), (2) done by server on the fly (easiest), (3) done by
 application (can be slow)

• Realistic   comparison of CDNs would require weeks of monitoring
                                        18
CHECKLIST
✓ Minify and combine CSS & JavaScript (load JS asynchronously when possible)
✓ Compress images and use web/tablet/smartphone resolutions
✓ Combine small images into sprites or use inline images with data URIs (IE7 requires
   MHTML: http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/)

✓ Gzip HTML, CSS & JS. Pre-compress files when possible.
✓ Load large resources from CDN, possibly using multiple hosts
✓ Long cache TTL for static assets + invalidate with versioning (main-xyz.css / main.css?xyz)
✓ Advanced: lazy loading, async CSS, HTML5 cache, JS pre-execution, response prediction
                                              19
APPENDIX



   20
Start     Repeat
                               Requests Load time Page size First byte
                                                                       render    view
Original
   Amsterdam, Netherlands         43     3.9 s   206 kB
   Dallas, TX, USA                43     7.8 s   206 kB
   Dulles, VA, USA                44     4.7 s   227 kB        1.5 s     2.8 s     4.0 s
   Jiangsu, China                 45    17.3 s   228 kB        2.9 s     8.0 s    13.8 s
Caching
   Amsterdam, Netherlands         43     1.3 s   161 kB
   Dallas, TX, USA                43     3.1 s   161 kB
   Dulles, VA, USA                44     3.3 s   180 kB        1.0 s     2.0 s     2.7 s
   Jiangsu, China                 44    11.2 s   178 kB        2.1 s     6.2 s     9.5 s
Parallel CDNs (CloudFront), Combined images, Pre-gzip
   Amsterdam, Netherlands         37     0.5 s   113 kB
   Dallas, TX, USA                37     2.4 s   113 kB
   Dulles, VA, USA                 6     2.3 s   114 kB        0.9 s     2.1 s     0.8 s
   Jiangsu, China                 26     6.2 s   145 kB        2.1 s     3.9 s     1.3 s

                                        21
JOOMLA SETTINGS
• JotCache   plugin               • CDN   for Joomla plugin



                                                      NB: images must be
                                                      present in CDN if
                                                       locally referenced
                                                           from CSS




                             22
RESOURCES - ANALYTICS
• Pingdom    Full Page Test, http://tools.pingdom.com/fpt/

• WebPageTest, http://www.webpagetest.org/

• REDbot    (cache testing), http://redbot.org/

• Loads   In, http://loads.in/

• Cloud   Speed Test (CDN comparison), http://cloudharmony.com/speedtest

• DNS   Check, http://www.webdnstools.com/dnstools/domain_check
                                         23
RESOURCES - COMPRESSION
• Smush.it, http://www.smushit.com/ysmush.it/

• YUI   Compressor, http://yuilibrary.com/download/yuicompressor/
          java -jar yuicompressor-2.4.7.jar -o '.css$:-min.css' *.css
          java -jar yuicompressor-2.4.7.jar -o '.js$:-min.js' *.js

• In   case you need to manually copy all assets to CDN:
          tar c $(find <source_dir> ( -name "*.bmp" -o -name "*.gif" -o -name "*.jpg" -o -name
          "*.jpeg" -o -name "*.png" -o -name "*.css*" -o -name "*.js*" )) | tar xv -C <dest_dir>


• SmartSprites, http://csssprites.org/, SpriteMe, http://spriteme.org/
                                                         24

Más contenido relacionado

La actualidad más candente

004 architecture andadvanceduse
004 architecture andadvanceduse004 architecture andadvanceduse
004 architecture andadvanceduseScott Miao
 
초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기OnGameServer
 
AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...
AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...
AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...Amazon Web Services
 
Accelerating hbase with nvme and bucket cache
Accelerating hbase with nvme and bucket cacheAccelerating hbase with nvme and bucket cache
Accelerating hbase with nvme and bucket cacheDavid Grier
 
Postgres in Amazon RDS
Postgres in Amazon RDSPostgres in Amazon RDS
Postgres in Amazon RDSDenish Patel
 
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.Takatoshi Matsuo
 
TechTalk v2.0 - Performance tuning Cassandra + AWS
TechTalk v2.0 - Performance tuning Cassandra + AWSTechTalk v2.0 - Performance tuning Cassandra + AWS
TechTalk v2.0 - Performance tuning Cassandra + AWSPythian
 
Faster and Smaller qcow2 Files with Subcluster-based Allocation
Faster and Smaller qcow2 Files with Subcluster-based AllocationFaster and Smaller qcow2 Files with Subcluster-based Allocation
Faster and Smaller qcow2 Files with Subcluster-based AllocationIgalia
 
Mysql story in poi dedup
Mysql story in poi dedupMysql story in poi dedup
Mysql story in poi dedupfeng lee
 
Cassandra in Operation
Cassandra in OperationCassandra in Operation
Cassandra in Operationniallmilton
 
Cassandra Operations at Netflix
Cassandra Operations at NetflixCassandra Operations at Netflix
Cassandra Operations at Netflixgreggulrich
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephRongze Zhu
 
Spark / Mesos Cluster Optimization
Spark / Mesos Cluster OptimizationSpark / Mesos Cluster Optimization
Spark / Mesos Cluster Optimizationebiznext
 

La actualidad más candente (20)

004 architecture andadvanceduse
004 architecture andadvanceduse004 architecture andadvanceduse
004 architecture andadvanceduse
 
초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기
 
cosbench-openstack.pdf
cosbench-openstack.pdfcosbench-openstack.pdf
cosbench-openstack.pdf
 
Cosbench apac
Cosbench apacCosbench apac
Cosbench apac
 
AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...
AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...
AWS Webcast - Achieving consistent high performance with Postgres on Amazon W...
 
Accelerating hbase with nvme and bucket cache
Accelerating hbase with nvme and bucket cacheAccelerating hbase with nvme and bucket cache
Accelerating hbase with nvme and bucket cache
 
PostgreSQL Query Cache - "pqc"
PostgreSQL Query Cache - "pqc"PostgreSQL Query Cache - "pqc"
PostgreSQL Query Cache - "pqc"
 
Postgres in Amazon RDS
Postgres in Amazon RDSPostgres in Amazon RDS
Postgres in Amazon RDS
 
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
 
TechTalk v2.0 - Performance tuning Cassandra + AWS
TechTalk v2.0 - Performance tuning Cassandra + AWSTechTalk v2.0 - Performance tuning Cassandra + AWS
TechTalk v2.0 - Performance tuning Cassandra + AWS
 
Faster and Smaller qcow2 Files with Subcluster-based Allocation
Faster and Smaller qcow2 Files with Subcluster-based AllocationFaster and Smaller qcow2 Files with Subcluster-based Allocation
Faster and Smaller qcow2 Files with Subcluster-based Allocation
 
Mysql story in poi dedup
Mysql story in poi dedupMysql story in poi dedup
Mysql story in poi dedup
 
Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Cassandra in Operation
Cassandra in OperationCassandra in Operation
Cassandra in Operation
 
92 grand prix_2013
92 grand prix_201392 grand prix_2013
92 grand prix_2013
 
How swift is your Swift - SD.pptx
How swift is your Swift - SD.pptxHow swift is your Swift - SD.pptx
How swift is your Swift - SD.pptx
 
optimizing_ceph_flash
optimizing_ceph_flashoptimizing_ceph_flash
optimizing_ceph_flash
 
Cassandra Operations at Netflix
Cassandra Operations at NetflixCassandra Operations at Netflix
Cassandra Operations at Netflix
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
 
Spark / Mesos Cluster Optimization
Spark / Mesos Cluster OptimizationSpark / Mesos Cluster Optimization
Spark / Mesos Cluster Optimization
 

Destacado

Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by StepKim Stefan Lindholm
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimizationStevie T
 
Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...
Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...
Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...Strangeloop
 
Front end optimization
Front end optimizationFront end optimization
Front end optimizationAbhishek Anand
 
Front-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPressFront-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPressdrywallbmb
 
Marrying CDNs with Front-End Optimization
Marrying CDNs with Front-End Optimization Marrying CDNs with Front-End Optimization
Marrying CDNs with Front-End Optimization Strangeloop
 
Heavy Web Optimization: Frontend
Heavy Web Optimization: FrontendHeavy Web Optimization: Frontend
Heavy Web Optimization: FrontendVõ Duy Tuấn
 
Vasona Networks @ Telco Vision 2013
Vasona Networks @ Telco Vision 2013Vasona Networks @ Telco Vision 2013
Vasona Networks @ Telco Vision 2013vasonanetworks
 

Destacado (10)

Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by Step
 
IPv6 Measurements
IPv6 MeasurementsIPv6 Measurements
IPv6 Measurements
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
 
Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...
Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...
Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...
 
Front end optimization
Front end optimizationFront end optimization
Front end optimization
 
Front-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPressFront-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPress
 
Marrying CDNs with Front-End Optimization
Marrying CDNs with Front-End Optimization Marrying CDNs with Front-End Optimization
Marrying CDNs with Front-End Optimization
 
Heavy Web Optimization: Frontend
Heavy Web Optimization: FrontendHeavy Web Optimization: Frontend
Heavy Web Optimization: Frontend
 
Vasona Networks @ Telco Vision 2013
Vasona Networks @ Telco Vision 2013Vasona Networks @ Telco Vision 2013
Vasona Networks @ Telco Vision 2013
 
Image processing ppt
Image processing pptImage processing ppt
Image processing ppt
 

Similar a Front-End Optimization (FEO)

WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningTimothy Wood
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfcodearachnid_test
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfcodearachnid_test
 
Considerations for building your private cloud folsom update
Considerations for building your private cloud   folsom updateConsiderations for building your private cloud   folsom update
Considerations for building your private cloud folsom updateRyan Richard
 
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC
 
Mongo DB Athens user group replication and high availability
Mongo DB Athens user group replication and high availabilityMongo DB Athens user group replication and high availability
Mongo DB Athens user group replication and high availabilityagiamas
 
LCA13: Hadoop DFS Performance
LCA13: Hadoop DFS PerformanceLCA13: Hadoop DFS Performance
LCA13: Hadoop DFS PerformanceLinaro
 
Practical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobsPractical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobsFlink Forward
 
Scaling Django for X Factor - DJUGL Oct 2012
Scaling Django for X Factor - DJUGL Oct 2012Scaling Django for X Factor - DJUGL Oct 2012
Scaling Django for X Factor - DJUGL Oct 2012Malcolm Box
 
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...Amazon Web Services
 
Voldemort on Solid State Drives
Voldemort on Solid State DrivesVoldemort on Solid State Drives
Voldemort on Solid State DrivesVinoth Chandar
 
Voldemort on Solid State Drives
Voldemort on Solid State DrivesVoldemort on Solid State Drives
Voldemort on Solid State DrivesAmy W. Tang
 
LCA13: Web Server and Caching Technologies
LCA13: Web Server and Caching TechnologiesLCA13: Web Server and Caching Technologies
LCA13: Web Server and Caching TechnologiesLinaro
 
Boyan Ivanov - latency, the #1 metric of your cloud
Boyan Ivanov - latency, the #1 metric of your cloudBoyan Ivanov - latency, the #1 metric of your cloud
Boyan Ivanov - latency, the #1 metric of your cloudShapeBlue
 
Page Performance
Page PerformancePage Performance
Page Performancestk_jj
 

Similar a Front-End Optimization (FEO) (20)

WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & Tuning
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdf
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdf
 
Considerations for building your private cloud folsom update
Considerations for building your private cloud   folsom updateConsiderations for building your private cloud   folsom update
Considerations for building your private cloud folsom update
 
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
 
Mongo DB Athens user group replication and high availability
Mongo DB Athens user group replication and high availabilityMongo DB Athens user group replication and high availability
Mongo DB Athens user group replication and high availability
 
NVMe over Fabric
NVMe over FabricNVMe over Fabric
NVMe over Fabric
 
LCA13: Hadoop DFS Performance
LCA13: Hadoop DFS PerformanceLCA13: Hadoop DFS Performance
LCA13: Hadoop DFS Performance
 
Practical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobsPractical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobs
 
Scaling Django for X Factor - DJUGL Oct 2012
Scaling Django for X Factor - DJUGL Oct 2012Scaling Django for X Factor - DJUGL Oct 2012
Scaling Django for X Factor - DJUGL Oct 2012
 
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
 
Voldemort on Solid State Drives
Voldemort on Solid State DrivesVoldemort on Solid State Drives
Voldemort on Solid State Drives
 
Voldemort on Solid State Drives
Voldemort on Solid State DrivesVoldemort on Solid State Drives
Voldemort on Solid State Drives
 
Caching for Cash - Part 4
Caching for Cash - Part 4Caching for Cash - Part 4
Caching for Cash - Part 4
 
A faster web
A faster webA faster web
A faster web
 
LCA13: Web Server and Caching Technologies
LCA13: Web Server and Caching TechnologiesLCA13: Web Server and Caching Technologies
LCA13: Web Server and Caching Technologies
 
Boyan Ivanov - latency, the #1 metric of your cloud
Boyan Ivanov - latency, the #1 metric of your cloudBoyan Ivanov - latency, the #1 metric of your cloud
Boyan Ivanov - latency, the #1 metric of your cloud
 
Page Performance
Page PerformancePage Performance
Page Performance
 

Último

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
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
🐬 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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

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
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Front-End Optimization (FEO)

  • 1. Improving Site Response Time Part 1: Front-End Optimization (FEO) Kim Stefan Lindholm 1 26.1.2012
  • 2. SETUP • Server: CloudControl (Dublin, Ireland) with local Varnish HTTP accelerator • CMS (Content Management System): Joomla 1.5 • WAF (Web Application Firewall): Incapsula • CDN (Content Delivery Network): Akamai (Rackspace) & Amazon CloudFront • Anycast DNS: DNS Made Easy NB: Incapsula and Akamai automatically serve compressed (gzip) files 2
  • 3. RESULTS Proxy servers may take some time to refresh their cache, which can delay performance improvement. Browser & server cache + compression Minify images, CSS & JS Combine Gzip HTML, CSS & JS Inline images, No caching Pre-gzip, CDN Main page, average response time (ms) 3 Pingdom Panel, global average
  • 4. LOAD TIME 18 s 14 s Original 9s Caching CloudFront, inline, gzip 5s Amsterdam Dallas, TX Dulles, VA Jiangsu, China 4
  • 5. LOAD TIME Amsterdam Dallas, TX Chrome Chrome -87% -69% Dulles, VA Jiangsu IE 8 IE 7 -51% -64% 5
  • 6. How much were we able to decrease costly HTTP requests? 6
  • 7. CACHED VS. FINAL HTTP Requests -83% Total Weight -30% Original total weight was 206K 7 Yahoo YSlow add-on for Chrome
  • 8. Did Incapsula web proxy/firewall contribute to the results? 8
  • 9. INCAPSULA Incapsula caching seemed to be affected by incoming traffic (site popularity) and not so much by changes in the website itself (cacheability etc.) 9
  • 10. Speed difference between Incapsula proxy and global CDN (measured in Europe)? 10
  • 11. PROXY VS. CDN Average load speed (real) tested with 10 iterations: time curl [--compressed] <url> > /dev/null 2,500 ms 1,875 ms No proxy Incapsula Incapsula, gzip 1,250 ms Compressed Akamai size: 34k Compressed Akamai, gzip size: 3k Slowest 1st load: 1400 ms 625 ms mootools.js (116k) template.css (11k) template_ie7.css (2k) 11
  • 12. PROXY VS. CDN • Standarddeviation with Akamai CDN was notable. At worst, fetching a 2k file was 3x slower than with the original unproxied connection. • Withcompression on, first loads seemed very slow. This is acceptable, of course, if gzipping and pushing to cache only happens infrequently. • Given the additional overhead of compression and DNS lookups, small files (<10k) are not automatically perfect candidates for CDN. Combine images using sprites instead. 12
  • 13. Speed difference between Akamai and Amazon CloudFront? 13
  • 14. CDN COMPARISON Akamai, gzip CloudFront, gzip 14 Pingdom Panel, Response time report
  • 15. CDN COMPARISON Main page first load speed, CDN allowed to propagate for one day 9s 7s Akamai, gzip CloudFront CloudFront, gzip 5s 2s Amsterdam Dallas Los Angeles Singapore Tokyo 15
  • 16. CDN COMPARISON Main page second load speed, CDN allowed to propagate for one day 9s 7s Akamai, gzip CloudFront CloudFront, gzip 5s 2s CDNs seem quite equal in performance. Amsterdam Dallas Los Angeles Singapore Tokyo 16
  • 17. RE VIS PROXY VS. CDN ITE D Average load speed (real) tested with 3 iterations: time curl --compressed <url> > /dev/null File: css-main-data.gz.css (73k) Transparent bar denotes 1st load 13 s 10 s Incapsula, gzip 8s Akamai, gzip CloudFront, gzip 5s 3s Akamai was the steadiest performer Norway UK US Japan globally. 17
  • 18. LEARNINGS • CDN for large files and gzipping are always good for performance • CDN for small files can actually slow down performance • Parallelizing across hosts works fine (2-4 hosts recommended by Yahoo) • Options for gzipping CSS & JS: (1) Pre-compress and serve the right version (fastest), (2) done by server on the fly (easiest), (3) done by application (can be slow) • Realistic comparison of CDNs would require weeks of monitoring 18
  • 19. CHECKLIST ✓ Minify and combine CSS & JavaScript (load JS asynchronously when possible) ✓ Compress images and use web/tablet/smartphone resolutions ✓ Combine small images into sprites or use inline images with data URIs (IE7 requires MHTML: http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/) ✓ Gzip HTML, CSS & JS. Pre-compress files when possible. ✓ Load large resources from CDN, possibly using multiple hosts ✓ Long cache TTL for static assets + invalidate with versioning (main-xyz.css / main.css?xyz) ✓ Advanced: lazy loading, async CSS, HTML5 cache, JS pre-execution, response prediction 19
  • 20. APPENDIX 20
  • 21. Start Repeat Requests Load time Page size First byte render view Original Amsterdam, Netherlands 43 3.9 s 206 kB Dallas, TX, USA 43 7.8 s 206 kB Dulles, VA, USA 44 4.7 s 227 kB 1.5 s 2.8 s 4.0 s Jiangsu, China 45 17.3 s 228 kB 2.9 s 8.0 s 13.8 s Caching Amsterdam, Netherlands 43 1.3 s 161 kB Dallas, TX, USA 43 3.1 s 161 kB Dulles, VA, USA 44 3.3 s 180 kB 1.0 s 2.0 s 2.7 s Jiangsu, China 44 11.2 s 178 kB 2.1 s 6.2 s 9.5 s Parallel CDNs (CloudFront), Combined images, Pre-gzip Amsterdam, Netherlands 37 0.5 s 113 kB Dallas, TX, USA 37 2.4 s 113 kB Dulles, VA, USA 6 2.3 s 114 kB 0.9 s 2.1 s 0.8 s Jiangsu, China 26 6.2 s 145 kB 2.1 s 3.9 s 1.3 s 21
  • 22. JOOMLA SETTINGS • JotCache plugin • CDN for Joomla plugin NB: images must be present in CDN if locally referenced from CSS 22
  • 23. RESOURCES - ANALYTICS • Pingdom Full Page Test, http://tools.pingdom.com/fpt/ • WebPageTest, http://www.webpagetest.org/ • REDbot (cache testing), http://redbot.org/ • Loads In, http://loads.in/ • Cloud Speed Test (CDN comparison), http://cloudharmony.com/speedtest • DNS Check, http://www.webdnstools.com/dnstools/domain_check 23
  • 24. RESOURCES - COMPRESSION • Smush.it, http://www.smushit.com/ysmush.it/ • YUI Compressor, http://yuilibrary.com/download/yuicompressor/ java -jar yuicompressor-2.4.7.jar -o '.css$:-min.css' *.css java -jar yuicompressor-2.4.7.jar -o '.js$:-min.js' *.js • In case you need to manually copy all assets to CDN: tar c $(find <source_dir> ( -name "*.bmp" -o -name "*.gif" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.css*" -o -name "*.js*" )) | tar xv -C <dest_dir> • SmartSprites, http://csssprites.org/, SpriteMe, http://spriteme.org/ 24