SlideShare a Scribd company logo
1 of 15
Download to read offline
APACHE SLING & FRIENDS TECH MEETUP
BERLIN, 26-28 SEPTEMBER 2012
Sling Dynamic Include
declarative caching of partially personalized pages
Tomasz Rękawek
adaptTo() 2012
 Our CQ site contains a lot of static pages
 Therefore they can be cached
 Unfortunatelly, there is one small dynamic
component
 Current user info
 Latest news
 Random article
 External content
 ...
2
Introduction
adaptTo() 2012 3
Geometrixx example – userinfo component
adaptTo() 2012
 Dispatcher is great in caching static pages
 However, even a small dynamic component
makes it useless
 We want to cache the almost whole page
 Selected component should be included
dynamically, directly from the CQ
4
Problem
adaptTo() 2012
 Dispatcher should cache site with some
static placeholder
 We replace placeholder with the dynamic
content after dispatcher serves the site
 Helpful Sling feature: we can render only a
part of the page using it URL
5
Solution
http://localhost:4503/content/geometrixx/en/_jcr_content/userinfo.html
adaptTo() 2012
 So, we can place some include tag which
will be replaced with the component
 Include tag types available on different
service layers between dispatcher and the
client:
6
Solution
CQ instance Dispatcher Apache Content delivery network Browser
Server side
includes
Edge site
includes
AJAX
adaptTo() 2012
 AJAX is a common solution here
 Drawbacks
 problems with components containing JS
 may not work (smoothly or at all) on mobiles
 not SEO friendly
 slows down the site
 flickering components
7
AJAX
adaptTo() 2012
 Advantages over AJAX
 Transparent for the browser / search engine
 Drawbacks
 requires developers to have configured
additional servers (Apache or Varnish)
 developers should be aware of the environment
 components should be written in a special way
8
SSI/ESI
adaptTo() 2012
 Java servlet filter
 It affects components with specific
resource types only
 Replaces it with:
 SSI
 ESI
 AJAX include markup
9
Sling Dynamic Include
adaptTo() 2012 10
SDI – how does it work?
Filter the include sub-request
/content/…/_jcr_content/carousel.html
<!--include
/content/…/carousel.nocache.html-->
Content
Pass it
Get page
Content
Component content
Filter the request
Request
component
/content/…/_jcr_content/carousel.nocache.html
httpd SDI
adaptTo() 2012
 Approach transparent for the components
 and developers as well
 Configured using OSGi console
 can be disabled on the author / developers
instances
 include tag type can be easy changed
 Support for the nonexisting resources
11
SDI – advantages
adaptTo() 2012
 Nonexisting (or synthetic) resource – resource without
any JCR node
 JSP file excerpt:
<cq:include
path="footer"
resourceType="foundation/components/footer"/>
 But footer node doesn’t exist
 Component is rendered normally, because it doesn’t
need any data
 However, requesting
http://.../_jcr_content/footer.html will return 404
 SDI is able to recognize nonexisting resources and
render them 12
Nonexisting resources
adaptTo() 2012 13
Performance comparison
0
200
400
600
800
1000
1200
1400
1 2 3 4 5 6 7 8 9 10
Dispatcher+SDI
Cache disabled
Concurrent requests
Request/s
 Number of requests per second vs number of concurrent
requests
 Geometrixx site
 SDI includes userinfo component
 8 threads: 1265 req/s with and 131 req/s without SDI
 Basically, it’s a difference between rendering the whole page
and a small part of it
adaptTo() 2012
 SDI is available on our Github
 https://github.com/Cognifide
 Any questions?
14
Q&A
adaptTo() 2012 15
Thanks

More Related Content

What's hot

SPA Editing with Sling to the rescue - adaptTo() 2021
SPA Editing with Sling to the rescue - adaptTo() 2021 SPA Editing with Sling to the rescue - adaptTo() 2021
SPA Editing with Sling to the rescue - adaptTo() 2021 Hanish Bansal
 
AEM GEMS Session SAML authentication in AEM
AEM GEMS Session SAML authentication in AEMAEM GEMS Session SAML authentication in AEM
AEM GEMS Session SAML authentication in AEMAdobeMarketingCloud
 
AEM 6.1 User Interface Customization
AEM 6.1 User Interface CustomizationAEM 6.1 User Interface Customization
AEM 6.1 User Interface CustomizationChristian Meyer
 
12 hot features to engage and save time with aem 6.2
12 hot features to engage and save time with aem 6.212 hot features to engage and save time with aem 6.2
12 hot features to engage and save time with aem 6.2Tricode (part of Dept)
 
Three WEM Dev Tricks
Three WEM Dev TricksThree WEM Dev Tricks
Three WEM Dev TricksGabriel Walt
 
CIRCUIT 2015 - Content API's For AEM Sites
CIRCUIT 2015 - Content API's For AEM SitesCIRCUIT 2015 - Content API's For AEM Sites
CIRCUIT 2015 - Content API's For AEM SitesICF CIRCUIT
 
AEM Sightly Template Language
AEM Sightly Template LanguageAEM Sightly Template Language
AEM Sightly Template LanguageGabriel Walt
 
AEM target Integration
AEM target IntegrationAEM target Integration
AEM target IntegrationKanika Gera
 
10 reasons to migrate from AEM 5 to 6.1
10 reasons to migrate from AEM 5 to 6.110 reasons to migrate from AEM 5 to 6.1
10 reasons to migrate from AEM 5 to 6.1Tricode (part of Dept)
 
Accelerate Your Next AEM Project
Accelerate Your Next AEM ProjectAccelerate Your Next AEM Project
Accelerate Your Next AEM ProjectMark Kelley
 
User interface customization for aem6 circuit
User interface customization for aem6 circuitUser interface customization for aem6 circuit
User interface customization for aem6 circuitDamien Antipa
 
Web Apps atop a Content Repository
Web Apps atop a Content RepositoryWeb Apps atop a Content Repository
Web Apps atop a Content RepositoryGabriel Walt
 
Maximize the power of OSGi in AEM
Maximize the power of OSGi in AEM Maximize the power of OSGi in AEM
Maximize the power of OSGi in AEM ICF CIRCUIT
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughBradley Holt
 
CQ Provisionning & Authoring
CQ Provisionning & AuthoringCQ Provisionning & Authoring
CQ Provisionning & AuthoringGabriel Walt
 
Sling Component Filters in CQ5
Sling Component Filters in CQ5 Sling Component Filters in CQ5
Sling Component Filters in CQ5 connectwebex
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVAYash Mody
 
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
The New Way of Developing with AEM 6.0 | Sightly | Beautiful MarkupThe New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
The New Way of Developing with AEM 6.0 | Sightly | Beautiful MarkupSenol Tas
 

What's hot (20)

SPA Editing with Sling to the rescue - adaptTo() 2021
SPA Editing with Sling to the rescue - adaptTo() 2021 SPA Editing with Sling to the rescue - adaptTo() 2021
SPA Editing with Sling to the rescue - adaptTo() 2021
 
AEM GEMS Session SAML authentication in AEM
AEM GEMS Session SAML authentication in AEMAEM GEMS Session SAML authentication in AEM
AEM GEMS Session SAML authentication in AEM
 
AEM 6.1 User Interface Customization
AEM 6.1 User Interface CustomizationAEM 6.1 User Interface Customization
AEM 6.1 User Interface Customization
 
12 hot features to engage and save time with aem 6.2
12 hot features to engage and save time with aem 6.212 hot features to engage and save time with aem 6.2
12 hot features to engage and save time with aem 6.2
 
Three WEM Dev Tricks
Three WEM Dev TricksThree WEM Dev Tricks
Three WEM Dev Tricks
 
CIRCUIT 2015 - Content API's For AEM Sites
CIRCUIT 2015 - Content API's For AEM SitesCIRCUIT 2015 - Content API's For AEM Sites
CIRCUIT 2015 - Content API's For AEM Sites
 
AEM Sightly Template Language
AEM Sightly Template LanguageAEM Sightly Template Language
AEM Sightly Template Language
 
AEM target Integration
AEM target IntegrationAEM target Integration
AEM target Integration
 
10 reasons to migrate from AEM 5 to 6.1
10 reasons to migrate from AEM 5 to 6.110 reasons to migrate from AEM 5 to 6.1
10 reasons to migrate from AEM 5 to 6.1
 
Accelerate Your Next AEM Project
Accelerate Your Next AEM ProjectAccelerate Your Next AEM Project
Accelerate Your Next AEM Project
 
User interface customization for aem6 circuit
User interface customization for aem6 circuitUser interface customization for aem6 circuit
User interface customization for aem6 circuit
 
Web Apps atop a Content Repository
Web Apps atop a Content RepositoryWeb Apps atop a Content Repository
Web Apps atop a Content Repository
 
Maximize the power of OSGi in AEM
Maximize the power of OSGi in AEM Maximize the power of OSGi in AEM
Maximize the power of OSGi in AEM
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start Walkthrough
 
CQ Provisionning & Authoring
CQ Provisionning & AuthoringCQ Provisionning & Authoring
CQ Provisionning & Authoring
 
Sling Component Filters in CQ5
Sling Component Filters in CQ5 Sling Component Filters in CQ5
Sling Component Filters in CQ5
 
Sling Models Overview
Sling Models OverviewSling Models Overview
Sling Models Overview
 
Aem best practices
Aem best practicesAem best practices
Aem best practices
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVA
 
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
The New Way of Developing with AEM 6.0 | Sightly | Beautiful MarkupThe New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
 

Similar to Sling Dynamic Include

Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...Marios Fakiolas
 
Web Components: Introduction and Practical Use Cases
Web Components: Introduction and Practical Use CasesWeb Components: Introduction and Practical Use Cases
Web Components: Introduction and Practical Use Casessumitamar
 
SPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager SitesSPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager SitesGabriel Walt
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...Andrei Sebastian Cîmpean
 
Leveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in GutenbergLeveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in GutenbergFelix Arntz
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGiPaul Bakker
 
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?CodeValue
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMAdobeMarketingCloud
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMAdobeMarketingCloud
 
Apache Shindig, from Server Side Portlets to Open Social Gadgets
Apache Shindig, from Server Side Portlets to Open Social GadgetsApache Shindig, from Server Side Portlets to Open Social Gadgets
Apache Shindig, from Server Side Portlets to Open Social GadgetsTyrell Perera
 
Umbraco Cape Town Meetup Presentation
Umbraco Cape Town Meetup PresentationUmbraco Cape Town Meetup Presentation
Umbraco Cape Town Meetup PresentationBluegrass Digital
 
Pre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlifyPre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlifynuppla
 
Web Components: back to the future
Web Components: back to the futureWeb Components: back to the future
Web Components: back to the futureDA-14
 
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 PreviewMarrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 PreviewLucas Jellema
 
What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)Mahmoud Hamed Mahmoud
 
five Sling features you should know
five Sling features you should knowfive Sling features you should know
five Sling features you should knowconnectwebex
 
Introduction to spring
Introduction to springIntroduction to spring
Introduction to springodedns
 

Similar to Sling Dynamic Include (20)

Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...
 
Web Components: Introduction and Practical Use Cases
Web Components: Introduction and Practical Use CasesWeb Components: Introduction and Practical Use Cases
Web Components: Introduction and Practical Use Cases
 
SPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager SitesSPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager Sites
 
micro-frontends-with-vuejs
micro-frontends-with-vuejsmicro-frontends-with-vuejs
micro-frontends-with-vuejs
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...
 
Leveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in GutenbergLeveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in Gutenberg
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGi
 
Marrying together the worlds of ADF and HTML5 & AngularJS - Oracle OpenWorld ...
Marrying together the worlds of ADF and HTML5 & AngularJS - Oracle OpenWorld ...Marrying together the worlds of ADF and HTML5 & AngularJS - Oracle OpenWorld ...
Marrying together the worlds of ADF and HTML5 & AngularJS - Oracle OpenWorld ...
 
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
 
Apache Shindig, from Server Side Portlets to Open Social Gadgets
Apache Shindig, from Server Side Portlets to Open Social GadgetsApache Shindig, from Server Side Portlets to Open Social Gadgets
Apache Shindig, from Server Side Portlets to Open Social Gadgets
 
Umbraco Cape Town Meetup Presentation
Umbraco Cape Town Meetup PresentationUmbraco Cape Town Meetup Presentation
Umbraco Cape Town Meetup Presentation
 
Drupalcon Mumbai
Drupalcon MumbaiDrupalcon Mumbai
Drupalcon Mumbai
 
Pre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlifyPre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlify
 
Web Components: back to the future
Web Components: back to the futureWeb Components: back to the future
Web Components: back to the future
 
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 PreviewMarrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
 
What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)
 
five Sling features you should know
five Sling features you should knowfive Sling features you should know
five Sling features you should know
 
Introduction to spring
Introduction to springIntroduction to spring
Introduction to spring
 

More from Tomasz Rękawek

Deep-dive into cloud-native AEM deployments based on Kubernetes
Deep-dive into cloud-native AEM deployments based on KubernetesDeep-dive into cloud-native AEM deployments based on Kubernetes
Deep-dive into cloud-native AEM deployments based on KubernetesTomasz Rękawek
 
Emulating Game Boy in Java
Emulating Game Boy in JavaEmulating Game Boy in Java
Emulating Game Boy in JavaTomasz Rękawek
 
Zero downtime deployments for the Sling-based apps using Docker
Zero downtime deployments for the Sling-based apps using DockerZero downtime deployments for the Sling-based apps using Docker
Zero downtime deployments for the Sling-based apps using DockerTomasz Rękawek
 
CRX2Oak - all the secrets of repository migration
CRX2Oak - all the secrets of repository migrationCRX2Oak - all the secrets of repository migration
CRX2Oak - all the secrets of repository migrationTomasz Rękawek
 
Inter-Sling communication with message queue
Inter-Sling communication with message queueInter-Sling communication with message queue
Inter-Sling communication with message queueTomasz Rękawek
 
Shooting rabbits with sling
Shooting rabbits with slingShooting rabbits with sling
Shooting rabbits with slingTomasz Rękawek
 

More from Tomasz Rękawek (9)

Radio ad blocker
Radio ad blockerRadio ad blocker
Radio ad blocker
 
Deep-dive into cloud-native AEM deployments based on Kubernetes
Deep-dive into cloud-native AEM deployments based on KubernetesDeep-dive into cloud-native AEM deployments based on Kubernetes
Deep-dive into cloud-native AEM deployments based on Kubernetes
 
Emulating Game Boy in Java
Emulating Game Boy in JavaEmulating Game Boy in Java
Emulating Game Boy in Java
 
Zero downtime deployments for the Sling-based apps using Docker
Zero downtime deployments for the Sling-based apps using DockerZero downtime deployments for the Sling-based apps using Docker
Zero downtime deployments for the Sling-based apps using Docker
 
CRX2Oak - all the secrets of repository migration
CRX2Oak - all the secrets of repository migrationCRX2Oak - all the secrets of repository migration
CRX2Oak - all the secrets of repository migration
 
SlingQuery
SlingQuerySlingQuery
SlingQuery
 
Code metrics
Code metricsCode metrics
Code metrics
 
Inter-Sling communication with message queue
Inter-Sling communication with message queueInter-Sling communication with message queue
Inter-Sling communication with message queue
 
Shooting rabbits with sling
Shooting rabbits with slingShooting rabbits with sling
Shooting rabbits with sling
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
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
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
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
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
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
 
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
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
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
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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!
 
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)
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
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
 
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
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Sling Dynamic Include

  • 1. APACHE SLING & FRIENDS TECH MEETUP BERLIN, 26-28 SEPTEMBER 2012 Sling Dynamic Include declarative caching of partially personalized pages Tomasz Rękawek
  • 2. adaptTo() 2012  Our CQ site contains a lot of static pages  Therefore they can be cached  Unfortunatelly, there is one small dynamic component  Current user info  Latest news  Random article  External content  ... 2 Introduction
  • 3. adaptTo() 2012 3 Geometrixx example – userinfo component
  • 4. adaptTo() 2012  Dispatcher is great in caching static pages  However, even a small dynamic component makes it useless  We want to cache the almost whole page  Selected component should be included dynamically, directly from the CQ 4 Problem
  • 5. adaptTo() 2012  Dispatcher should cache site with some static placeholder  We replace placeholder with the dynamic content after dispatcher serves the site  Helpful Sling feature: we can render only a part of the page using it URL 5 Solution http://localhost:4503/content/geometrixx/en/_jcr_content/userinfo.html
  • 6. adaptTo() 2012  So, we can place some include tag which will be replaced with the component  Include tag types available on different service layers between dispatcher and the client: 6 Solution CQ instance Dispatcher Apache Content delivery network Browser Server side includes Edge site includes AJAX
  • 7. adaptTo() 2012  AJAX is a common solution here  Drawbacks  problems with components containing JS  may not work (smoothly or at all) on mobiles  not SEO friendly  slows down the site  flickering components 7 AJAX
  • 8. adaptTo() 2012  Advantages over AJAX  Transparent for the browser / search engine  Drawbacks  requires developers to have configured additional servers (Apache or Varnish)  developers should be aware of the environment  components should be written in a special way 8 SSI/ESI
  • 9. adaptTo() 2012  Java servlet filter  It affects components with specific resource types only  Replaces it with:  SSI  ESI  AJAX include markup 9 Sling Dynamic Include
  • 10. adaptTo() 2012 10 SDI – how does it work? Filter the include sub-request /content/…/_jcr_content/carousel.html <!--include /content/…/carousel.nocache.html--> Content Pass it Get page Content Component content Filter the request Request component /content/…/_jcr_content/carousel.nocache.html httpd SDI
  • 11. adaptTo() 2012  Approach transparent for the components  and developers as well  Configured using OSGi console  can be disabled on the author / developers instances  include tag type can be easy changed  Support for the nonexisting resources 11 SDI – advantages
  • 12. adaptTo() 2012  Nonexisting (or synthetic) resource – resource without any JCR node  JSP file excerpt: <cq:include path="footer" resourceType="foundation/components/footer"/>  But footer node doesn’t exist  Component is rendered normally, because it doesn’t need any data  However, requesting http://.../_jcr_content/footer.html will return 404  SDI is able to recognize nonexisting resources and render them 12 Nonexisting resources
  • 13. adaptTo() 2012 13 Performance comparison 0 200 400 600 800 1000 1200 1400 1 2 3 4 5 6 7 8 9 10 Dispatcher+SDI Cache disabled Concurrent requests Request/s  Number of requests per second vs number of concurrent requests  Geometrixx site  SDI includes userinfo component  8 threads: 1265 req/s with and 131 req/s without SDI  Basically, it’s a difference between rendering the whole page and a small part of it
  • 14. adaptTo() 2012  SDI is available on our Github  https://github.com/Cognifide  Any questions? 14 Q&A