SlideShare ist ein Scribd-Unternehmen logo
1 von 26
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von hazzaz

Coffee1
Coffee1Coffee1
Coffee1hazzaz
 
Suy ngam
Suy ngamSuy ngam
Suy ngamhazzaz
 
Tu dong dat hang tu he thong ban le lon nhat trung quoc
Tu dong dat hang tu he thong ban le lon nhat trung quocTu dong dat hang tu he thong ban le lon nhat trung quoc
Tu dong dat hang tu he thong ban le lon nhat trung quochazzaz
 
how startups can benefit from launch community
how startups can benefit from launch communityhow startups can benefit from launch community
how startups can benefit from launch communityhazzaz
 
social network game
social network gamesocial network game
social network gamehazzaz
 
trung oss magento overview
trung oss magento overviewtrung oss magento overview
trung oss magento overviewhazzaz
 
su dung drupal xay dung mang xa hoi
su dung drupal xay dung mang xa hoisu dung drupal xay dung mang xa hoi
su dung drupal xay dung mang xa hoihazzaz
 
html5 css3 the future of web technology
html5 css3 the future of web technologyhtml5 css3 the future of web technology
html5 css3 the future of web technologyhazzaz
 
java script unit testing framework
java script unit testing frameworkjava script unit testing framework
java script unit testing frameworkhazzaz
 
build your own php extension
build your own php extensionbuild your own php extension
build your own php extensionhazzaz
 
kiem tien online
kiem tien onlinekiem tien online
kiem tien onlinehazzaz
 
speed up ntvv2 by php ext module
speed up ntvv2 by php ext modulespeed up ntvv2 by php ext module
speed up ntvv2 by php ext modulehazzaz
 
zingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphpzingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphphazzaz
 
mysql optimization
mysql optimizationmysql optimization
mysql optimizationhazzaz
 
EAV in Magento
EAV in MagentoEAV in Magento
EAV in Magentohazzaz
 
css_trends
css_trendscss_trends
css_trendshazzaz
 
Phan mem tu do nguon mo
Phan mem tu do nguon moPhan mem tu do nguon mo
Phan mem tu do nguon mohazzaz
 

Mehr von hazzaz (20)

Coffee1
Coffee1Coffee1
Coffee1
 
Suy ngam
Suy ngamSuy ngam
Suy ngam
 
Tu dong dat hang tu he thong ban le lon nhat trung quoc
Tu dong dat hang tu he thong ban le lon nhat trung quocTu dong dat hang tu he thong ban le lon nhat trung quoc
Tu dong dat hang tu he thong ban le lon nhat trung quoc
 
how startups can benefit from launch community
how startups can benefit from launch communityhow startups can benefit from launch community
how startups can benefit from launch community
 
social network game
social network gamesocial network game
social network game
 
trung oss magento overview
trung oss magento overviewtrung oss magento overview
trung oss magento overview
 
su dung drupal xay dung mang xa hoi
su dung drupal xay dung mang xa hoisu dung drupal xay dung mang xa hoi
su dung drupal xay dung mang xa hoi
 
html5 css3 the future of web technology
html5 css3 the future of web technologyhtml5 css3 the future of web technology
html5 css3 the future of web technology
 
java script unit testing framework
java script unit testing frameworkjava script unit testing framework
java script unit testing framework
 
build your own php extension
build your own php extensionbuild your own php extension
build your own php extension
 
kiem tien online
kiem tien onlinekiem tien online
kiem tien online
 
speed up ntvv2 by php ext module
speed up ntvv2 by php ext modulespeed up ntvv2 by php ext module
speed up ntvv2 by php ext module
 
zingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphpzingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphp
 
mysql optimization
mysql optimizationmysql optimization
mysql optimization
 
EAV in Magento
EAV in MagentoEAV in Magento
EAV in Magento
 
Albus
AlbusAlbus
Albus
 
css_trends
css_trendscss_trends
css_trends
 
Cloud
CloudCloud
Cloud
 
Phan mem tu do nguon mo
Phan mem tu do nguon moPhan mem tu do nguon mo
Phan mem tu do nguon mo
 
Zing
ZingZing
Zing
 

Kürzlich hochgeladen

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
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
 
"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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 

Kürzlich hochgeladen (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
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
 
"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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.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)
 

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