SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Performance optimization for a
TYPO3 website


                 Alexandre Gravel-Raymond, Web developer
                              a.gravel-raymond@alienor.net
                  Aliénor.net : Bordeaux based Web agency
Plan


I – TYPO3 presentation

II - Performance and limits of standard rendering

III - Solutions
Enterprise level solution

Multilingual, multidomain websites
Workflows
Powerful user rights management
Great importance given to retro-compatibility
More than 4000 extensions on the TYPO3 Extension
Repository (TER)


                      I – TYPO3 presentation
            II - Performance and limits of standard rendering
                              III - Solutions
Typoscript

Tree-based configuration langage (forming templates)

No functions (but references to PHP functions)

No variable (but the possibility to use a registry for
information exchange between parts of the template)




                     I – TYPO3 presentation
           II - Performance and limits of standard rendering
                             III - Solutions
Criticism about TYPO3


End user: The website seems slow.
Sys admin: The server load can be important on complex
websites.




                      I – TYPO3 presentation
            II - Performance and limits of standard rendering
                              III - Solutions
Performance and limits of
standard rendering
Solutions to the
         performance issues
Three main reflexion areas:
     Code optimization: of course !
     Make the application lighter: not at the expense of
     flexibility !
     Fine-grained cache : this is the way.




                              I – TYPO3 presentation
               II - Performance and limits of standard rendering
                                  III - Solutions
Standard cache

TypoScript objects composing a template fits in two
categories :
     Cacheable objects (USER plugins, TEXT objects,
     Content Object Array - COA, etc.)
     Dynamic (non-cacheable) objects (USER_INT plugins,
     dynamic Content Object Array - COA_INT)




                      I – TYPO3 presentation
       II - Performance and limits of standard rendering
                          III - Solutions
When the requested page is
   not cached yet

Standard (cached) typoscript objects are rendered
Dynamic (_INT) typoscript objects are replaced by specially
crafted tags (<!--INT_SCRIPT … >)
The result is stored in the cache system (usally the database)
A second rendering phase replaces the tags by the
corresponding objects' HTML representation
The final document is sent to the user




                       I – TYPO3 presentation
        II - Performance and limits of standard rendering
                           III - Solutions
When the requested page is
   in cache

The cached representation of the page is pulled from the
cache system
Tags representing dynamic objects are replaced by the
objects' HTML representation
The final document is sent to the user




                      I – TYPO3 presentation
       II - Performance and limits of standard rendering
                          III - Solutions
Limits of the cache system


Every request, including those concerning already
cached pages, force the web server to execute
TYPO3.
It is (very) resource-intensive




                       I – TYPO3 presentation
        II - Performance and limits of standard rendering
                           III - Solutions
Solutions
Alternative solution :
   nc_staticfilecache


Extension developed by Netcreators
Some benchmarks show a page delivery speed
multiplication by 230 !




                        I – TYPO3 presentation
           II - Performance and limits of standard rendering
                           III - Solutions
nc_staticfilecache extension



Stores the final document in a static HTML file
This file (if it is present) is directly delivered by the web
server
PHP and TYPO3 are not loaded at all !
If the static cache is not found, the standard rendering
process is executed


                         I – TYPO3 presentation
            II - Performance and limits of standard rendering
                            III - Solutions
nc_staticfilecache advantages


Follows standard TYPO3 cache rules (ex: if the cached version of a
page has expired, the corresponding static file is deleted
Possibility to extend static cache delivery rules in a .htaccess file :
    Ex : Cookie identifying users that must have a dynamic version
    of the website
Possibility to deactivate the static cache on a page-by-page basis




                      I – TYPO3 presentation
         II - Performance and limits of standard rendering
                           III - Solutions
Installing nc_staticfilecache


Apache and mod_rewrite are needed
Download and install the extension :
    http://forge.typo3.org/projects/extension-nc_staticfilecache
Add basic rewrite rules given in the example .htaccess file
Add a cronjob that points to the script that cleans expired
static files (via scheduler)




                    I – TYPO3 presentation
       II - Performance and limits of standard rendering
                         III - Solutions
nc_staticfilecache constraints


POST requests are excluded (to maintain the dynamic
nature of the forms)
All GET parameters must be rewritten on statically cached
pages (with realurl or cooluri extensions)
No page containing dynamic (_INT) objects will have static
cache
One solution to have a dynamic page : make the _INT
object static, and use AJAX to render the « personalized »
content (use with caution)


                        I – TYPO3 presentation
           II - Performance and limits of standard rendering
                           III - Solutions
Architectural solutions


Use Nginx as a reverse proxy to deliver static files
(lighter and quicker than Apache)
Use eAccelerator or another PHP op-code cache
system to boost PHP performance for dynamic pages
and for the first hits of static pages




                         I – TYPO3 presentation
            II - Performance and limits of standard rendering
                            III - Solutions
For dynamic plugins



When the standard cache system doesn't help and
nc_staticfilecache doesn't apply

Use an alternate cache system
   Memcached is a « high-performance, distributed
   memory object caching system » that can help override
   bottlenecks in an application.
   Since TYPO3 4.3, you can define an alternate cache
   backend (file or memcached instead of database)


                        I – TYPO3 presentation
           II - Performance and limits of standard rendering
                           III - Solutions
Further optimization : reduce the
   number of HTTP requests


CSS and JS fusion / minification tools (TYPO3 extensions)

 scriptmerger: extensive configuration, possibility to
 exclude individual files
 load_optimization: HTML compression, only files added
 via typoscript are processed
 js_css_optimizer: uses the new page rendering API, fine-
 grained configuration file by file
 Minify: easy to install and use


                        I – TYPO3 presentation
           II - Performance and limits of standard rendering
                           III - Solutions
Good practices
Good practice #1


Do not deactivate the cache ! When you have cache
problems, refrain from doing this :
   www.example.com/?no_cache=1
   $GLOBALS[‘TSFE’]->set_no_cache() ;
   config.no_cache = 1 (typoscript template)
   « No cache » checkbox in backend in the page properties form




                         I – TYPO3 presentation
            II - Performance and limits of standard rendering
                            III - Solutions
Good practice #2


Adapt the cache duration to the project
   Ex: At least one day for a typical publication website

Make TYPO3 clear the cache of affected pages
automatically when needed
   In page TSConfig : TCEMAIN.clearCacheCmd = 1,2,3




                          I – TYPO3 presentation
             II - Performance and limits of standard rendering
                             III - Solutions
Good practice #3


Audit the extensions you use
With the help of the community…




                       I – TYPO3 presentation
          II - Performance and limits of standard rendering
                          III - Solutions
Good practice #4


Uninstall unused extensions (they can load typoscript
or PHP), even if an autoloading mecanism was
introduced in TYPO3 4.3




                        I – TYPO3 presentation
           II - Performance and limits of standard rendering
                           III - Solutions
Good practice #5


Lessen the complexity of the typoscript templates
It is possible to accomplish very complex tasks in pure
typoscript, but sometimes it's more clear to encapsulate
the functionnality in a specialized PHP class, and you
get more speed at the same time.




                        I – TYPO3 presentation
           II - Performance and limits of standard rendering
                           III - Solutions
Good practice #6

For parts of the website that don't need it, do not use the
full TYPO3 rendering mecanism
     AJAX script can be externalized with the eID
     method :
           www.example.com/index.php?eID=ajax_script
           Only loads necessary parts of TYPO3 core

     Do 404 error pages need to be dynamic ? Prefer the
     standard ErrorDocument method.


                         I – TYPO3 presentation
            II - Performance and limits of standard rendering
                            III - Solutions
Good practice #7


Optimize SQL tables added by your extensions with
well chosen indices, notably if it was automatically
created with the Kickstarter




                        I – TYPO3 presentation
           II - Performance and limits of standard rendering
                           III - Solutions
Some further reading
http://wiki.typo3.org/index.php/Performance_tuning
http://typo3.org/development/articles/testing-and-
tuning-typo3-performance/
http://techblog.evo.pl/en/evo_nginx_boost-extension/
http://www.typofree.org/article/archive/2009/august/
title/enabling-nc-staticfilecache-in-typo3-nginx/
http://typo3.org/development/articles/using-cache-
control-headers-in-typo3/

Contenu connexe

Similaire à Performance optimization for a TYPO3 website

The new repository in AEM 6
The new repository in AEM 6The new repository in AEM 6
The new repository in AEM 6Jukka Zitting
 
from Docker to Moby and back. what changed ?
from Docker to Moby and back. what changed ?from Docker to Moby and back. what changed ?
from Docker to Moby and back. what changed ?strikr .
 
TYPO3 - great enterprise CMS - YEJJ
TYPO3 - great enterprise CMS - YEJJTYPO3 - great enterprise CMS - YEJJ
TYPO3 - great enterprise CMS - YEJJThảo Nguyễn
 
Automated Multiplatform Compilation and Validation of a Collaborative Reposit...
Automated Multiplatform Compilation and Validation of a Collaborative Reposit...Automated Multiplatform Compilation and Validation of a Collaborative Reposit...
Automated Multiplatform Compilation and Validation of a Collaborative Reposit...Ángel Jesús Martínez Bernal
 
Fast and Reproducible Deep Learning
Fast and Reproducible Deep LearningFast and Reproducible Deep Learning
Fast and Reproducible Deep LearningGreg Gandenberger
 
TYPO3 Performance (T3DD18)
TYPO3 Performance (T3DD18)TYPO3 Performance (T3DD18)
TYPO3 Performance (T3DD18)Marcus Schwemer
 
2018 - CertiFUNcation - Marcus Schwemer: TYPO3 Performance
2018 - CertiFUNcation - Marcus Schwemer: TYPO3 Performance2018 - CertiFUNcation - Marcus Schwemer: TYPO3 Performance
2018 - CertiFUNcation - Marcus Schwemer: TYPO3 PerformanceTYPO3 CertiFUNcation
 
YANG push Integration into Apache Kafka
YANG push Integration into Apache KafkaYANG push Integration into Apache Kafka
YANG push Integration into Apache KafkaThomasGraf42
 
MyMobileWeb Certification Part IV
MyMobileWeb Certification Part IVMyMobileWeb Certification Part IV
MyMobileWeb Certification Part IVcrdlc
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Pantheon
 
TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013die.agilen GmbH
 
Backend-Skin in TYPO3 4.4: Technical changes under the hood (T3DD10)
Backend-Skin in TYPO3 4.4: Technical changes under the hood (T3DD10)Backend-Skin in TYPO3 4.4: Technical changes under the hood (T3DD10)
Backend-Skin in TYPO3 4.4: Technical changes under the hood (T3DD10)Steffen Gebert
 
IBM MQ in Containers - Think 2018
IBM MQ in Containers - Think 2018IBM MQ in Containers - Think 2018
IBM MQ in Containers - Think 2018Robert Parker
 
CFEngine, 4 years later
CFEngine, 4 years laterCFEngine, 4 years later
CFEngine, 4 years laterRUDDER
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityTeamstudio
 
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)Issac Buenrostro
 

Similaire à Performance optimization for a TYPO3 website (20)

The new repository in AEM 6
The new repository in AEM 6The new repository in AEM 6
The new repository in AEM 6
 
from Docker to Moby and back. what changed ?
from Docker to Moby and back. what changed ?from Docker to Moby and back. what changed ?
from Docker to Moby and back. what changed ?
 
TYPO3 - great enterprise CMS - YEJJ
TYPO3 - great enterprise CMS - YEJJTYPO3 - great enterprise CMS - YEJJ
TYPO3 - great enterprise CMS - YEJJ
 
Automated Multiplatform Compilation and Validation of a Collaborative Reposit...
Automated Multiplatform Compilation and Validation of a Collaborative Reposit...Automated Multiplatform Compilation and Validation of a Collaborative Reposit...
Automated Multiplatform Compilation and Validation of a Collaborative Reposit...
 
AtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMSAtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMS
 
Fast and Reproducible Deep Learning
Fast and Reproducible Deep LearningFast and Reproducible Deep Learning
Fast and Reproducible Deep Learning
 
TYPO3 Performance (T3DD18)
TYPO3 Performance (T3DD18)TYPO3 Performance (T3DD18)
TYPO3 Performance (T3DD18)
 
2018 - CertiFUNcation - Marcus Schwemer: TYPO3 Performance
2018 - CertiFUNcation - Marcus Schwemer: TYPO3 Performance2018 - CertiFUNcation - Marcus Schwemer: TYPO3 Performance
2018 - CertiFUNcation - Marcus Schwemer: TYPO3 Performance
 
YANG push Integration into Apache Kafka
YANG push Integration into Apache KafkaYANG push Integration into Apache Kafka
YANG push Integration into Apache Kafka
 
MyMobileWeb Certification Part IV
MyMobileWeb Certification Part IVMyMobileWeb Certification Part IV
MyMobileWeb Certification Part IV
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
TYPO3 at UNESCO.org
TYPO3 at UNESCO.orgTYPO3 at UNESCO.org
TYPO3 at UNESCO.org
 
TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013
 
Backend-Skin in TYPO3 4.4: Technical changes under the hood (T3DD10)
Backend-Skin in TYPO3 4.4: Technical changes under the hood (T3DD10)Backend-Skin in TYPO3 4.4: Technical changes under the hood (T3DD10)
Backend-Skin in TYPO3 4.4: Technical changes under the hood (T3DD10)
 
IBM MQ in Containers - Think 2018
IBM MQ in Containers - Think 2018IBM MQ in Containers - Think 2018
IBM MQ in Containers - Think 2018
 
Crosslingual search-engine
Crosslingual search-engineCrosslingual search-engine
Crosslingual search-engine
 
edeploy
edeployedeploy
edeploy
 
CFEngine, 4 years later
CFEngine, 4 years laterCFEngine, 4 years later
CFEngine, 4 years later
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate Usability
 
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
 

Dernier

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 

Dernier (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Performance optimization for a TYPO3 website

  • 1. Performance optimization for a TYPO3 website Alexandre Gravel-Raymond, Web developer a.gravel-raymond@alienor.net Aliénor.net : Bordeaux based Web agency
  • 2. Plan I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 3. Enterprise level solution Multilingual, multidomain websites Workflows Powerful user rights management Great importance given to retro-compatibility More than 4000 extensions on the TYPO3 Extension Repository (TER) I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 4. Typoscript Tree-based configuration langage (forming templates) No functions (but references to PHP functions) No variable (but the possibility to use a registry for information exchange between parts of the template) I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 5. Criticism about TYPO3 End user: The website seems slow. Sys admin: The server load can be important on complex websites. I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 6. Performance and limits of standard rendering
  • 7. Solutions to the performance issues Three main reflexion areas: Code optimization: of course ! Make the application lighter: not at the expense of flexibility ! Fine-grained cache : this is the way. I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 8. Standard cache TypoScript objects composing a template fits in two categories : Cacheable objects (USER plugins, TEXT objects, Content Object Array - COA, etc.) Dynamic (non-cacheable) objects (USER_INT plugins, dynamic Content Object Array - COA_INT) I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 9. When the requested page is not cached yet Standard (cached) typoscript objects are rendered Dynamic (_INT) typoscript objects are replaced by specially crafted tags (<!--INT_SCRIPT … >) The result is stored in the cache system (usally the database) A second rendering phase replaces the tags by the corresponding objects' HTML representation The final document is sent to the user I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 10. When the requested page is in cache The cached representation of the page is pulled from the cache system Tags representing dynamic objects are replaced by the objects' HTML representation The final document is sent to the user I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 11. Limits of the cache system Every request, including those concerning already cached pages, force the web server to execute TYPO3. It is (very) resource-intensive I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 13. Alternative solution : nc_staticfilecache Extension developed by Netcreators Some benchmarks show a page delivery speed multiplication by 230 ! I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 14. nc_staticfilecache extension Stores the final document in a static HTML file This file (if it is present) is directly delivered by the web server PHP and TYPO3 are not loaded at all ! If the static cache is not found, the standard rendering process is executed I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 15. nc_staticfilecache advantages Follows standard TYPO3 cache rules (ex: if the cached version of a page has expired, the corresponding static file is deleted Possibility to extend static cache delivery rules in a .htaccess file : Ex : Cookie identifying users that must have a dynamic version of the website Possibility to deactivate the static cache on a page-by-page basis I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 16. Installing nc_staticfilecache Apache and mod_rewrite are needed Download and install the extension : http://forge.typo3.org/projects/extension-nc_staticfilecache Add basic rewrite rules given in the example .htaccess file Add a cronjob that points to the script that cleans expired static files (via scheduler) I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 17. nc_staticfilecache constraints POST requests are excluded (to maintain the dynamic nature of the forms) All GET parameters must be rewritten on statically cached pages (with realurl or cooluri extensions) No page containing dynamic (_INT) objects will have static cache One solution to have a dynamic page : make the _INT object static, and use AJAX to render the « personalized » content (use with caution) I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 18. Architectural solutions Use Nginx as a reverse proxy to deliver static files (lighter and quicker than Apache) Use eAccelerator or another PHP op-code cache system to boost PHP performance for dynamic pages and for the first hits of static pages I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 19. For dynamic plugins When the standard cache system doesn't help and nc_staticfilecache doesn't apply Use an alternate cache system Memcached is a « high-performance, distributed memory object caching system » that can help override bottlenecks in an application. Since TYPO3 4.3, you can define an alternate cache backend (file or memcached instead of database) I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 20. Further optimization : reduce the number of HTTP requests CSS and JS fusion / minification tools (TYPO3 extensions) scriptmerger: extensive configuration, possibility to exclude individual files load_optimization: HTML compression, only files added via typoscript are processed js_css_optimizer: uses the new page rendering API, fine- grained configuration file by file Minify: easy to install and use I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 22. Good practice #1 Do not deactivate the cache ! When you have cache problems, refrain from doing this : www.example.com/?no_cache=1 $GLOBALS[‘TSFE’]->set_no_cache() ; config.no_cache = 1 (typoscript template) « No cache » checkbox in backend in the page properties form I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 23. Good practice #2 Adapt the cache duration to the project Ex: At least one day for a typical publication website Make TYPO3 clear the cache of affected pages automatically when needed In page TSConfig : TCEMAIN.clearCacheCmd = 1,2,3 I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 24. Good practice #3 Audit the extensions you use With the help of the community… I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 25. Good practice #4 Uninstall unused extensions (they can load typoscript or PHP), even if an autoloading mecanism was introduced in TYPO3 4.3 I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 26. Good practice #5 Lessen the complexity of the typoscript templates It is possible to accomplish very complex tasks in pure typoscript, but sometimes it's more clear to encapsulate the functionnality in a specialized PHP class, and you get more speed at the same time. I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 27. Good practice #6 For parts of the website that don't need it, do not use the full TYPO3 rendering mecanism AJAX script can be externalized with the eID method : www.example.com/index.php?eID=ajax_script Only loads necessary parts of TYPO3 core Do 404 error pages need to be dynamic ? Prefer the standard ErrorDocument method. I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions
  • 28. Good practice #7 Optimize SQL tables added by your extensions with well chosen indices, notably if it was automatically created with the Kickstarter I – TYPO3 presentation II - Performance and limits of standard rendering III - Solutions