SlideShare a Scribd company logo
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/

More Related Content

Similar to 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 6
Jukka 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
 
AtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMSAtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMS
NITSAN Technologies Pvt Ltd
 
Fast and Reproducible Deep Learning
Fast and Reproducible Deep LearningFast and Reproducible Deep Learning
Fast and Reproducible Deep Learning
Greg 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 Performance
TYPO3 CertiFUNcation
 
YANG push Integration into Apache Kafka
YANG push Integration into Apache KafkaYANG push Integration into Apache Kafka
YANG push Integration into Apache Kafka
ThomasGraf42
 
MyMobileWeb Certification Part IV
MyMobileWeb Certification Part IVMyMobileWeb Certification Part IV
MyMobileWeb Certification Part IV
crdlc
 
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 at UNESCO.org
TYPO3 at UNESCO.orgTYPO3 at UNESCO.org
TYPO3 at UNESCO.org
Olivier Dobberkau
 
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
die.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 2018
Robert Parker
 
Crosslingual search-engine
Crosslingual search-engineCrosslingual search-engine
Crosslingual search-engine
Carlos Badenes-Olmedo
 
CFEngine, 4 years later
CFEngine, 4 years laterCFEngine, 4 years later
CFEngine, 4 years later
RUDDER
 
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
Teamstudio
 
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
 

Similar to 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)
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 

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