JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber
-
Upload
jahia-solutions-group -
Category
Technology
-
view
131 -
download
1
Transcript of JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber
Baking content with Jahia Digital Factory
Serge Huber, CTO, [email protected]
Baking vs Frying Difference in “when”
templates are applied to content
Baking : applied when content is published
Frying : applied when user requests a page
Baking vs Frying
Baking Frying
Page is dynamic ✅
Very fast to serve ✅
Low CPU usage ✅
Personalizable ✅
Baking vs Frying Jahia Digital Factory is a “frying” system DF has a built-in HTML cache system to
improve performance and lower CPU usage
In most scenarios “frying” makes the most sense
Baking use cases Purely static HTML site
needed But it could also use client-
side Javascript to make it dynamic (not SEO friendly though)
Also useful for building static HTML to be included in mobile applications that use Apache Cordova
History Initially created to generate static content to
build Mobile Applications using Apache Cordova framework
Generate HTML from DF site to sync website look and feel with native mobile apps
What is it ? A module to synchronize (or “bake”) content between
the JCR and different file systems Can be used to create static copies of Digital Factory
websites Uses Apache Commons VFS as a file system
abstraction Makes it possible to copy to : local file system, FTP,
SFTP, WebDAV + implement others (JCR)
How it works Uses a built-in web crawler to copy the HTML
and all static resources needed (CSS, Javascript, images, …)
Integrates with publishing system to trigger syncs on publication
Uses background jobs to perform the sync only on processing server (doesn’t impact other servers)
Sync output uses Apache Commons VFS to send content to others uses
Uses new static channels to generate alternate renders for new dynamic sync components
Channel integration Example with top-right search box Normally performs an internal
Jahia search engine call Using a separate channel
“static_html_ver1” we can configure an alternative view
This alternative view is configured to use a Google Site search on our synched static copy
The overview
Digital Factory
PHP Apps (Drupal,
phpBB, …)
.NET apps (Sitefinity
Content Syncdynamic
sync components
Dynamic sync components
Components can react to the extension used to generate the static synched copy (PHP, .NET, JSP)
The channel changes automatically for each extension
Makes it possible to generate custom output for each supported extension
A single component can render PHP, .NET or JSP code !
Dynamic sync component
Request info example : dump request info<h2>ASP Request headers</h2><table border="1" cellpadding="5" cellspacing="0"> <thead> <tr> <th>Header name</th> <th>Header value</th> </tr> </thead> <tbody><% for each x in Request.ServerVariables response.write("<tr><td>") response.write(x) response.write("</td><td>") response.write(Request.ServerVariables(x)) response.write("</td></tr>") next%> </tbody></table>
.NET (ASP)
<h2>PHP Request headers</h2><table border="1" cellpadding="5" cellspacing="0"> <thead> <tr> <th>Header name</th> <th>Header value</th> </tr> </thead> <tbody><?phpforeach (getallheaders() as $name => $value) { echo "<tr><td>$name</td><td>$value</td></tr>";}?> </tbody></table>
PHP
What needs to be done Improve administration UI / add image synching Native integrations with Marketing Factory Add/improve mobile project sync Optimize sync algorithm to avoid regenerating full site
everything all the time Improve sync implementation to support Ant patterns for
inclusion / exclusion Add more dynamic components
Other sync components ideas
“Hole” component that would just reference a native PHP/.NET/JSP scripts that exists on the destination servers
Components that integrate with other software such as SugarCRM (PHP) / Drupal (PHP) / Sitefinity (.NET)
Integration with existing custom software built/used in-house
The sky’s the limit… lots of other possibilities !
Where/when can I get it ? No horizon defined yet Open to collaborative dev Open to ideas / discussions with customers
To prioritize features To define scope / use cases