SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
Web optimization
                 oàn Văn Tuy n
                   Pentalog Vietnam
http://www.facebook.com/doanvantuyen   doanvantuyen@gmail.com




                                                                1
Gi i thi u chung
• M c đích:
  “Chia s m t s kinh nghi m giúp tăng t c
    đ truy c p vào website”
• Áp d ng:
  “Dành cho nh ng website có lư ng truy
    c p ít và trung bình v i tài nguyên h n
    ch ”


                    PHP DAY 18/12/2010        2
Content
1.   HTTP request flow diagram
2.   Optimizing Page generate
3.   Minimizing round-trip times
4.   Minimizing request / response size
5.   Optimizing brower rendering
6.   Tools for Optimizing


                   PHP DAY 18/12/2010     3
1. HTTP request flow diagram
                                                            DNS server


                                    t
                                u es
                             Req              se
                         S                  on
                        N                 sp                  PHP compile & parser
                       D                re
                                  S
                                DN
Render page
                                        Page HTTP request

                                    Page HTTP response
                                   Image, JS, CSS request

              Client                       Image, JS, CSS                            DB
                                                                Web server



                                                   PHP DAY 18/12/2010                     4
2. Optimizing Page generate

•   Cache
•   Opcode cache
•   Server Configuration
•   Optimize code & log analysis =>
    Xdebug



                  PHP DAY 18/12/2010   5
2.1 Cache
• What:
  – Page cache
  – Block cache
  – Data cache
• How:
  –   Write on file
  –   Memory
  –   Database
  –   Static/Global variable




                               PHP DAY 18/12/2010   6
2.2 Opcode cache
•APC
•PHP accelerator
•eAccelerator
•Alternative PHP
Cache
•ionCube PHP
Accelerator
•XCache
•Zend Accelerator




                    PHP DAY 18/12/2010   7
2.3 Server Configuration
• Apache
  – MPM, remove .htaccess, GZip, ETag, Cache
    control
• PHP
  – Maximum memory, maximum execution time…
• MySQL
  – Slow SQL log




                     PHP DAY 18/12/2010        8
2.4 Optimize code & log
analysis
• Demo XDebug
• Other debug statement
  –   pint_r($x) , print_r($x, true)
  –   var_dump()
  –   thow new Exception()
  –   debug_print_backtrace()
  –   microtime(true)
  –   …



                        PHP DAY 18/12/2010   9
3. Minimizing round-trip
times
•   Use brower’s cache
•   User external CSS & javascript
•   Avoid 404 error
•   Combine CSS & JS file
•   Use CDN (Content delivery network)
•   Parallel download


                  PHP DAY 18/12/2010     10
3.1 Use brower’s cache




            PHP DAY 18/12/2010   11
3.2 User external CSS &
javascript




             PHP DAY 18/12/2010   12
3.3 Avoid 404 error




            PHP DAY 18/12/2010   13
4.4 Combine CSS & JS file

GOOD




BAD




              PHP DAY 18/12/2010   14
4.5 Use CDN




              PHP DAY 18/12/2010   15
3.6 Parallel download




             PHP DAY 18/12/2010   16
4. Minimizing request /
response size
• Use a cookieless domain for static
  content
• Use GZip
• Minify HTML, CSS, Javascript
• Optimize Image (and favicon.ico)



                 PHP DAY 18/12/2010    17
4.1 Use a cookieless domain for static
content




                    PHP DAY 18/12/2010   18
4.2 Use GZip




               PHP DAY 18/12/2010   19
4.3 Minify HTML, CSS, JS




             PHP DAY 18/12/2010   20
4.4 Optimize images
• Do not use BMPs or TIFFs
• Use PNG, GIF for small image or
  simple graphics
• Use JPG for photo
• Reduce the size of image to fit with
  display area
• Use small & cacheable favicon.ico


                 PHP DAY 18/12/2010      21
5. Optimizing brower
   rendering
•       Put CSS on top, javascript on
        bottom
•       Specify image size
•       Post load & Pre load
•       Use smart event handle
    –    Use $(“a”).click(function(){}); thay cho <a href=
         “javascript: …”



                            PHP DAY 18/12/2010               22
6. Tools for Optimizing




           XDebug & WinCacheGrind




            PHP DAY 18/12/2010      23
6. Tools for Optimizing (Cont)




                                https://addons.mozilla.org/en-US/firefox/addon/1843/




http://code.google.com/speed/page-speed/download.html     https://addons.mozilla.org/en-US/firefox/addon/5369/
                                                  PHP DAY 18/12/2010                                      24
Reference
•   http://code.google.com/speed/page-speed/docs/rules_intro.html
•   http://developer.yahoo.com/performance/rules.html
•   http://www.xdebug.org/
•   https://addons.mozilla.org/en-US/firefox/addon/1843/
•   http://developer.yahoo.com/yslow/
•   http://code.google.com/speed/page-speed/
•   http://sourceforge.net/projects/wincachegrind




                                 PHP DAY 18/12/2010                 25
Thanks !




           26

Más contenido relacionado

La actualidad más candente

PHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on NginxPHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on NginxHarald Zeitlhofer
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibrePablo Moretti
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1hussulinux
 
PHP MySQL Training : Module 2
PHP MySQL Training : Module 2PHP MySQL Training : Module 2
PHP MySQL Training : Module 2hussulinux
 
Introduction to MongoDB and Ruby
Introduction to MongoDB and RubyIntroduction to MongoDB and Ruby
Introduction to MongoDB and RubyMongoDB
 
Hard Caching in TYPO3 - Developer Days in Malmø 2017
Hard Caching in TYPO3 - Developer Days in Malmø 2017Hard Caching in TYPO3 - Developer Days in Malmø 2017
Hard Caching in TYPO3 - Developer Days in Malmø 2017Benni Mack
 
MongoDB PhillyDB database throw down
MongoDB PhillyDB database throw downMongoDB PhillyDB database throw down
MongoDB PhillyDB database throw downzippy1981
 
Efficient Memory Mapped File I/O for In-Memory File Systems (HotStorage '17)
Efficient Memory Mapped File I/O for In-Memory File Systems (HotStorage '17)Efficient Memory Mapped File I/O for In-Memory File Systems (HotStorage '17)
Efficient Memory Mapped File I/O for In-Memory File Systems (HotStorage '17)Jungsik Choi
 
Simple Site Speed Improvements (SMX 2010)
Simple Site Speed Improvements (SMX 2010)Simple Site Speed Improvements (SMX 2010)
Simple Site Speed Improvements (SMX 2010)Ralf Schwoebel
 
What's behind facebook
What's behind facebookWhat's behind facebook
What's behind facebookAjen 陳
 
статические и динамические сайты
статические и динамические сайтыстатические и динамические сайты
статические и динамические сайтыlenum
 
Caching methodology and strategies
Caching methodology and strategiesCaching methodology and strategies
Caching methodology and strategiesTiep Vu
 

La actualidad más candente (18)

PHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on NginxPHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on Nginx
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
Running php on nginx
Running php on nginxRunning php on nginx
Running php on nginx
 
PHP MySQL Training : Module 2
PHP MySQL Training : Module 2PHP MySQL Training : Module 2
PHP MySQL Training : Module 2
 
Getting Started: The Environment
Getting Started: The EnvironmentGetting Started: The Environment
Getting Started: The Environment
 
Introduction to MongoDB and Ruby
Introduction to MongoDB and RubyIntroduction to MongoDB and Ruby
Introduction to MongoDB and Ruby
 
Hard Caching in TYPO3 - Developer Days in Malmø 2017
Hard Caching in TYPO3 - Developer Days in Malmø 2017Hard Caching in TYPO3 - Developer Days in Malmø 2017
Hard Caching in TYPO3 - Developer Days in Malmø 2017
 
Web subjects
Web subjectsWeb subjects
Web subjects
 
MongoDB PhillyDB database throw down
MongoDB PhillyDB database throw downMongoDB PhillyDB database throw down
MongoDB PhillyDB database throw down
 
Efficient Memory Mapped File I/O for In-Memory File Systems (HotStorage '17)
Efficient Memory Mapped File I/O for In-Memory File Systems (HotStorage '17)Efficient Memory Mapped File I/O for In-Memory File Systems (HotStorage '17)
Efficient Memory Mapped File I/O for In-Memory File Systems (HotStorage '17)
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Simple Site Speed Improvements (SMX 2010)
Simple Site Speed Improvements (SMX 2010)Simple Site Speed Improvements (SMX 2010)
Simple Site Speed Improvements (SMX 2010)
 
What's behind facebook
What's behind facebookWhat's behind facebook
What's behind facebook
 
статические и динамические сайты
статические и динамические сайтыстатические и динамические сайты
статические и динамические сайты
 
Caching methodology and strategies
Caching methodology and strategiesCaching methodology and strategies
Caching methodology and strategies
 

Destacado

Grade 1 Career Day
Grade 1 Career DayGrade 1 Career Day
Grade 1 Career DayJoel Marans
 
CrossMark and Other Interesting Developments, Aries EMUG Meeting at CrossRef
CrossMark and Other Interesting Developments, Aries EMUG Meeting at CrossRefCrossMark and Other Interesting Developments, Aries EMUG Meeting at CrossRef
CrossMark and Other Interesting Developments, Aries EMUG Meeting at CrossRefCrossref
 
Illinois Ethics Citation Presentation
Illinois Ethics Citation PresentationIllinois Ethics Citation Presentation
Illinois Ethics Citation PresentationMarki Lemons Ryhal
 
The press release on #CPSP 2013
The press release on #CPSP 2013The press release on #CPSP 2013
The press release on #CPSP 2013Irina Shamaeva
 
CrossRef For African Journals
CrossRef For African JournalsCrossRef For African Journals
CrossRef For African JournalsCrossref
 
2013 CrossRef Workshops System Update: Reference Deposit Processing , Jon Stark
2013 CrossRef Workshops System Update: Reference Deposit Processing, Jon Stark2013 CrossRef Workshops System Update: Reference Deposit Processing, Jon Stark
2013 CrossRef Workshops System Update: Reference Deposit Processing , Jon StarkCrossref
 
Rade Tricković - Oglasni potencijal web sajtova u Srbiji
Rade Tricković - Oglasni potencijal web sajtova u SrbijiRade Tricković - Oglasni potencijal web sajtova u Srbiji
Rade Tricković - Oglasni potencijal web sajtova u SrbijibiZbuZZ
 
What The App Presentation Podcamp East 2012
What The App Presentation Podcamp East 2012What The App Presentation Podcamp East 2012
What The App Presentation Podcamp East 2012Goldstein Media LLC
 
Pinterest and Instagram for 2013 REALTOR Conference and Expo
Pinterest and Instagram for 2013 REALTOR Conference and ExpoPinterest and Instagram for 2013 REALTOR Conference and Expo
Pinterest and Instagram for 2013 REALTOR Conference and ExpoMarki Lemons Ryhal
 

Destacado (11)

Javapolis
JavapolisJavapolis
Javapolis
 
Grade 1 Career Day
Grade 1 Career DayGrade 1 Career Day
Grade 1 Career Day
 
Uloga azoo u profesionalnom razvoju prosvjetnih djelatnika
Uloga azoo u profesionalnom razvoju prosvjetnih djelatnikaUloga azoo u profesionalnom razvoju prosvjetnih djelatnika
Uloga azoo u profesionalnom razvoju prosvjetnih djelatnika
 
CrossMark and Other Interesting Developments, Aries EMUG Meeting at CrossRef
CrossMark and Other Interesting Developments, Aries EMUG Meeting at CrossRefCrossMark and Other Interesting Developments, Aries EMUG Meeting at CrossRef
CrossMark and Other Interesting Developments, Aries EMUG Meeting at CrossRef
 
Illinois Ethics Citation Presentation
Illinois Ethics Citation PresentationIllinois Ethics Citation Presentation
Illinois Ethics Citation Presentation
 
The press release on #CPSP 2013
The press release on #CPSP 2013The press release on #CPSP 2013
The press release on #CPSP 2013
 
CrossRef For African Journals
CrossRef For African JournalsCrossRef For African Journals
CrossRef For African Journals
 
2013 CrossRef Workshops System Update: Reference Deposit Processing , Jon Stark
2013 CrossRef Workshops System Update: Reference Deposit Processing, Jon Stark2013 CrossRef Workshops System Update: Reference Deposit Processing, Jon Stark
2013 CrossRef Workshops System Update: Reference Deposit Processing , Jon Stark
 
Rade Tricković - Oglasni potencijal web sajtova u Srbiji
Rade Tricković - Oglasni potencijal web sajtova u SrbijiRade Tricković - Oglasni potencijal web sajtova u Srbiji
Rade Tricković - Oglasni potencijal web sajtova u Srbiji
 
What The App Presentation Podcamp East 2012
What The App Presentation Podcamp East 2012What The App Presentation Podcamp East 2012
What The App Presentation Podcamp East 2012
 
Pinterest and Instagram for 2013 REALTOR Conference and Expo
Pinterest and Instagram for 2013 REALTOR Conference and ExpoPinterest and Instagram for 2013 REALTOR Conference and Expo
Pinterest and Instagram for 2013 REALTOR Conference and Expo
 

Similar a 04 web optimization

Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend PerformanceThomas Weinert
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 
Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontendtkramar
 
Static resource-optimization using webutilities
Static resource-optimization using webutilitiesStatic resource-optimization using webutilities
Static resource-optimization using webutilitiesrpatil82
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsSiarhei Barysiuk
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonNeotys
 
WordPress Speed & Performance from Pagely's CTO
WordPress Speed & Performance from Pagely's CTOWordPress Speed & Performance from Pagely's CTO
WordPress Speed & Performance from Pagely's CTOLizzie Kardon
 
3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress Performance3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress PerformanceRF Studio
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applicationsChris Love
 
hbaseconasia2017: Building online HBase cluster of Zhihu based on Kubernetes
hbaseconasia2017: Building online HBase cluster of Zhihu based on Kuberneteshbaseconasia2017: Building online HBase cluster of Zhihu based on Kubernetes
hbaseconasia2017: Building online HBase cluster of Zhihu based on KubernetesHBaseCon
 
Pagespeed what, why, and how it works
Pagespeed   what, why, and how it worksPagespeed   what, why, and how it works
Pagespeed what, why, and how it worksIlya Grigorik
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek editionChris Love
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applicationsEugene Lazutkin
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceBrian Culver
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App TodayChris Love
 
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
#3 Hanoi Magento Meetup - Part 3: Magento Website OptimizationHanoi MagentoMeetup
 

Similar a 04 web optimization (20)

performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend Performance
 
Speed!
Speed!Speed!
Speed!
 
High performance website
High performance websiteHigh performance website
High performance website
 
Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend
 
Making the web faster
Making the web fasterMaking the web faster
Making the web faster
 
Static resource-optimization using webutilities
Static resource-optimization using webutilitiesStatic resource-optimization using webutilities
Static resource-optimization using webutilities
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark Tomlinson
 
WordPress Speed & Performance from Pagely's CTO
WordPress Speed & Performance from Pagely's CTOWordPress Speed & Performance from Pagely's CTO
WordPress Speed & Performance from Pagely's CTO
 
3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress Performance3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress Performance
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applications
 
hbaseconasia2017: Building online HBase cluster of Zhihu based on Kubernetes
hbaseconasia2017: Building online HBase cluster of Zhihu based on Kuberneteshbaseconasia2017: Building online HBase cluster of Zhihu based on Kubernetes
hbaseconasia2017: Building online HBase cluster of Zhihu based on Kubernetes
 
Pagespeed what, why, and how it works
Pagespeed   what, why, and how it worksPagespeed   what, why, and how it works
Pagespeed what, why, and how it works
 
Advanced Drupal 8 Caching
Advanced Drupal 8 CachingAdvanced Drupal 8 Caching
Advanced Drupal 8 Caching
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek edition
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 Performance
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today
 
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
 

Más de Nguyen Duc Phu

iOS Gaming with Cocos2d
iOS Gaming with Cocos2diOS Gaming with Cocos2d
iOS Gaming with Cocos2dNguyen Duc Phu
 
05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung Quoc
05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung Quoc05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung Quoc
05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung QuocNguyen Duc Phu
 
8 - Javascript unit testing framework
8 - Javascript unit testing framework8 - Javascript unit testing framework
8 - Javascript unit testing frameworkNguyen Duc Phu
 
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...Nguyen Duc Phu
 
Hanoi php day 2008 - 03. dang minh tuan - html, css, javascript
Hanoi php day 2008 - 03. dang minh tuan - html, css, javascriptHanoi php day 2008 - 03. dang minh tuan - html, css, javascript
Hanoi php day 2008 - 03. dang minh tuan - html, css, javascriptNguyen Duc Phu
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkNguyen Duc Phu
 
Hanoi php day 2008 - 02. phan thai trung - drupal
Hanoi php day 2008 - 02. phan thai trung - drupalHanoi php day 2008 - 02. phan thai trung - drupal
Hanoi php day 2008 - 02. phan thai trung - drupalNguyen Duc Phu
 
13 social network game
13 social network game13 social network game
13 social network gameNguyen Duc Phu
 
12 trung-oss-magento-overview
12 trung-oss-magento-overview12 trung-oss-magento-overview
12 trung-oss-magento-overviewNguyen Duc Phu
 
11 building joomla! extensions with flex integration
11 building joomla! extensions with flex integration11 building joomla! extensions with flex integration
11 building joomla! extensions with flex integrationNguyen Duc Phu
 
10 su dung drupal xay dung mang xa hoi
10 su dung drupal xay dung mang xa hoi10 su dung drupal xay dung mang xa hoi
10 su dung drupal xay dung mang xa hoiNguyen Duc Phu
 
09 html5 css3-the_future_of_web_technology
09 html5 css3-the_future_of_web_technology09 html5 css3-the_future_of_web_technology
09 html5 css3-the_future_of_web_technologyNguyen Duc Phu
 
07 build your-own_php_extension
07 build your-own_php_extension07 build your-own_php_extension
07 build your-own_php_extensionNguyen Duc Phu
 
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_Nguyen Duc Phu
 
01 zingme practice for building scalable website with php
01 zingme practice for building scalable website with php01 zingme practice for building scalable website with php
01 zingme practice for building scalable website with phpNguyen Duc Phu
 
14 how startups can benefit from launch community
14 how startups can benefit from launch community14 how startups can benefit from launch community
14 how startups can benefit from launch communityNguyen Duc Phu
 
Hanoi PHP Day 2008 - 04 - Nguyen Duc Phu - Search Engine: New Collection S...
Hanoi PHP Day 2008 -  04 - Nguyen Duc Phu  -  Search Engine: New Collection S...Hanoi PHP Day 2008 -  04 - Nguyen Duc Phu  -  Search Engine: New Collection S...
Hanoi PHP Day 2008 - 04 - Nguyen Duc Phu - Search Engine: New Collection S...Nguyen Duc Phu
 

Más de Nguyen Duc Phu (17)

iOS Gaming with Cocos2d
iOS Gaming with Cocos2diOS Gaming with Cocos2d
iOS Gaming with Cocos2d
 
05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung Quoc
05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung Quoc05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung Quoc
05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung Quoc
 
8 - Javascript unit testing framework
8 - Javascript unit testing framework8 - Javascript unit testing framework
8 - Javascript unit testing framework
 
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
 
Hanoi php day 2008 - 03. dang minh tuan - html, css, javascript
Hanoi php day 2008 - 03. dang minh tuan - html, css, javascriptHanoi php day 2008 - 03. dang minh tuan - html, css, javascript
Hanoi php day 2008 - 03. dang minh tuan - html, css, javascript
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
 
Hanoi php day 2008 - 02. phan thai trung - drupal
Hanoi php day 2008 - 02. phan thai trung - drupalHanoi php day 2008 - 02. phan thai trung - drupal
Hanoi php day 2008 - 02. phan thai trung - drupal
 
13 social network game
13 social network game13 social network game
13 social network game
 
12 trung-oss-magento-overview
12 trung-oss-magento-overview12 trung-oss-magento-overview
12 trung-oss-magento-overview
 
11 building joomla! extensions with flex integration
11 building joomla! extensions with flex integration11 building joomla! extensions with flex integration
11 building joomla! extensions with flex integration
 
10 su dung drupal xay dung mang xa hoi
10 su dung drupal xay dung mang xa hoi10 su dung drupal xay dung mang xa hoi
10 su dung drupal xay dung mang xa hoi
 
09 html5 css3-the_future_of_web_technology
09 html5 css3-the_future_of_web_technology09 html5 css3-the_future_of_web_technology
09 html5 css3-the_future_of_web_technology
 
07 build your-own_php_extension
07 build your-own_php_extension07 build your-own_php_extension
07 build your-own_php_extension
 
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_
 
01 zingme practice for building scalable website with php
01 zingme practice for building scalable website with php01 zingme practice for building scalable website with php
01 zingme practice for building scalable website with php
 
14 how startups can benefit from launch community
14 how startups can benefit from launch community14 how startups can benefit from launch community
14 how startups can benefit from launch community
 
Hanoi PHP Day 2008 - 04 - Nguyen Duc Phu - Search Engine: New Collection S...
Hanoi PHP Day 2008 -  04 - Nguyen Duc Phu  -  Search Engine: New Collection S...Hanoi PHP Day 2008 -  04 - Nguyen Duc Phu  -  Search Engine: New Collection S...
Hanoi PHP Day 2008 - 04 - Nguyen Duc Phu - Search Engine: New Collection S...
 

Último

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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"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
 
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
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
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
 
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
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Último (20)

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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"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
 
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
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
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
 
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
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

04 web optimization

  • 1. Web optimization oàn Văn Tuy n Pentalog Vietnam http://www.facebook.com/doanvantuyen doanvantuyen@gmail.com 1
  • 2. Gi i thi u chung • M c đích: “Chia s m t s kinh nghi m giúp tăng t c đ truy c p vào website” • Áp d ng: “Dành cho nh ng website có lư ng truy c p ít và trung bình v i tài nguyên h n ch ” PHP DAY 18/12/2010 2
  • 3. Content 1. HTTP request flow diagram 2. Optimizing Page generate 3. Minimizing round-trip times 4. Minimizing request / response size 5. Optimizing brower rendering 6. Tools for Optimizing PHP DAY 18/12/2010 3
  • 4. 1. HTTP request flow diagram DNS server t u es Req se S on N sp PHP compile & parser D re S DN Render page Page HTTP request Page HTTP response Image, JS, CSS request Client Image, JS, CSS DB Web server PHP DAY 18/12/2010 4
  • 5. 2. Optimizing Page generate • Cache • Opcode cache • Server Configuration • Optimize code & log analysis => Xdebug PHP DAY 18/12/2010 5
  • 6. 2.1 Cache • What: – Page cache – Block cache – Data cache • How: – Write on file – Memory – Database – Static/Global variable PHP DAY 18/12/2010 6
  • 7. 2.2 Opcode cache •APC •PHP accelerator •eAccelerator •Alternative PHP Cache •ionCube PHP Accelerator •XCache •Zend Accelerator PHP DAY 18/12/2010 7
  • 8. 2.3 Server Configuration • Apache – MPM, remove .htaccess, GZip, ETag, Cache control • PHP – Maximum memory, maximum execution time… • MySQL – Slow SQL log PHP DAY 18/12/2010 8
  • 9. 2.4 Optimize code & log analysis • Demo XDebug • Other debug statement – pint_r($x) , print_r($x, true) – var_dump() – thow new Exception() – debug_print_backtrace() – microtime(true) – … PHP DAY 18/12/2010 9
  • 10. 3. Minimizing round-trip times • Use brower’s cache • User external CSS & javascript • Avoid 404 error • Combine CSS & JS file • Use CDN (Content delivery network) • Parallel download PHP DAY 18/12/2010 10
  • 11. 3.1 Use brower’s cache PHP DAY 18/12/2010 11
  • 12. 3.2 User external CSS & javascript PHP DAY 18/12/2010 12
  • 13. 3.3 Avoid 404 error PHP DAY 18/12/2010 13
  • 14. 4.4 Combine CSS & JS file GOOD BAD PHP DAY 18/12/2010 14
  • 15. 4.5 Use CDN PHP DAY 18/12/2010 15
  • 16. 3.6 Parallel download PHP DAY 18/12/2010 16
  • 17. 4. Minimizing request / response size • Use a cookieless domain for static content • Use GZip • Minify HTML, CSS, Javascript • Optimize Image (and favicon.ico) PHP DAY 18/12/2010 17
  • 18. 4.1 Use a cookieless domain for static content PHP DAY 18/12/2010 18
  • 19. 4.2 Use GZip PHP DAY 18/12/2010 19
  • 20. 4.3 Minify HTML, CSS, JS PHP DAY 18/12/2010 20
  • 21. 4.4 Optimize images • Do not use BMPs or TIFFs • Use PNG, GIF for small image or simple graphics • Use JPG for photo • Reduce the size of image to fit with display area • Use small & cacheable favicon.ico PHP DAY 18/12/2010 21
  • 22. 5. Optimizing brower rendering • Put CSS on top, javascript on bottom • Specify image size • Post load & Pre load • Use smart event handle – Use $(“a”).click(function(){}); thay cho <a href= “javascript: …” PHP DAY 18/12/2010 22
  • 23. 6. Tools for Optimizing XDebug & WinCacheGrind PHP DAY 18/12/2010 23
  • 24. 6. Tools for Optimizing (Cont) https://addons.mozilla.org/en-US/firefox/addon/1843/ http://code.google.com/speed/page-speed/download.html https://addons.mozilla.org/en-US/firefox/addon/5369/ PHP DAY 18/12/2010 24
  • 25. Reference • http://code.google.com/speed/page-speed/docs/rules_intro.html • http://developer.yahoo.com/performance/rules.html • http://www.xdebug.org/ • https://addons.mozilla.org/en-US/firefox/addon/1843/ • http://developer.yahoo.com/yslow/ • http://code.google.com/speed/page-speed/ • http://sourceforge.net/projects/wincachegrind PHP DAY 18/12/2010 25
  • 26. Thanks ! 26