How to split components across domains with eZ Publish

The starting point of this post is an interesting asking of Marty_Nim (aka Nicolas Martinez) on Twitter about the ability to split static components across domains with eZ Publish to improve frontend performances.

Why split components across domains ?

Split components across domains is one of the advices of the Yahoo! Exceptionnal Performances team. This advice is a consequence of the behaviour of browsers that are able to download a limited number of compoments on a given domain at the same time. Following the RFC 2616, old browsers like Internet Explorer 6 or 7 are only able to download 2 components on a domain in parallel while modern browsers (Internet Explorer >=8, Firefox >=3.x, Chrome, ...) are able to download 6 or 8 ressources in parallel. Therefore, this rule is especially useful for those old browsers or if your pages use a lot of different components. It's also not recommended to use too much different domains because of the DNS resolution latency.

In eZ Publish

In eZ Publish, it is very easy to implement this advice for JavaScript files and CSS stylesheets provided the ezjscore operators (ezcss* and ezscript*) are used to include those files. In fact, the ezjscore extension allows to specify a custom hosts depending the extension of the included files. For instance, it's possible to write the following settings in an override of ezjscore.ini file :

[Packer]
CustomHosts[.js]=http://media1.pwet.fr
CustomHosts[.css]=http://media2.pwet.fr 

With those settings, eZ Publish will include the JavaScript file(s) from http://media1.pwet.fr, while CSS stylesheets will be included from http://media2.pwet.fr. The later case has an interesting side effect, because the background images used in the CSS files will also be fetched from the custom host.
And what about others components that are directly embed in templates ? Currently, there's no out of the box solution, but as explained by Gaetano on Twitter, since eZ Publish 4.4, it's possible to override template operators so it's possible to write something similar for images, flash, ... embed with ezimage, ezdesign or ezroot template operators even if this should probably be a native feature.

Quelques liens en vrac

En attendant d'avoir le temps d'écrire des articles avec un peu plus de contenu, voici quelques liens glanés ci et là ces derniers temps sur un peu tout :

La fin d'Internet Explorer 6 ?

Alsacréations fait le point sur les parts de marché d'Internet Explorer 6 et sur les nombreuses initiatives pour éjecter Internet Explorer 6 de l'Internet (l'image ci-dessus est issue de StopIE6.com). Sur le papier la situation s'améliore (les parts de marché global d'Internet Explorer 6 diminuent régulièrement) mais (parce qu'il y a un mais) je crois qu'on va encore devoir faire avec des navigateurs ne supportant pas les standards pendant encore un bon moment et encore je parle de standards déjà ancien (XHTML, CSS 2.1, SVG, ...) pas des derniers trucs à la mode à peine sortis des cartons. Pourquoi tant de pessimisme ?

  1. Internet Explorer 6 est sorti en 2001 et on en parle encore ! Il y a 8 ans, une éternité à l'échelle du web ! Et dans certaines entreprises, c'est encore le seul et l'unique navigateur et la première question du DSI dans une démo est Pouvez vous me montrer comment ça marche Internet Explorer 6 ?, on croit rêver, enfin cauchemarder.
  2. Une part des IE6 est/sera remplacée par IE7 qui est à peine mieux
  3. Une autre part des IE6 sera remplacée par Internet Explorer 8, obsolète avant même sa sortie

Bref, IE6 agonise peut être, mais il sera encore là pendant un bon moment et ses potentiels remplaçants sont certes un peu meilleurs mais loin de la concurrence. Il faudra encore attendre un moment pour que le métier de développeur web soit facile ;-)

pwet 2.0

Nouveau design, nouvelles couleurs, nouveaux templates, nouveaux bugs peut-être mais toujours eZ Publish ! ça me démangeait depuis un moment, je repoussais toujours en attendant l'intégration du composant Template d'eZ Components bien plus performant mais vue la nouvelle roadmap d'eZ Publish et le projet V, ce n'est pas encore pour tout de suite !

J'espère donc que c'est plus clair et lisible, moins buggé sous Internet Explorer notamment (fini les Peekaboo normalement) et surtout bien plus performant avec une gestion des caches plus fines (oui j'ai appris quelques trucs depuis Août 2006).

The new Online Editor for eZ Publish (beta)

For me it's probably one of the most waited feature in eZ Publish after the PHP5 port with eZ Publish 4 ! It's only a beta release but it looks very promising. There's a document in the SVN repository or in the archive explaining new features.

It's based on Tiny MCE rich text editor, so Internet Explorer (including IE7 under Windows Vista), browsers based on Gecko (Firefox ...), Opera and Safari are now supported and unlike the old one, there are not two code bases for two navigator families ! It's also more flexible as we can add or remove buttons and functionnalities (like an underline button). After reading the document and a small test, there is one feature I would like to see, it is the hability to easily customize the drop down list (paragraph, preformatted, headings) with others styles / tags like the style configuration in FCKEditor. It can probably be done with a Tiny MCE plugin but a simple setting in eztinymce.ini file would be a simple but very useful tool !

Flux RSS des billets

Flux RSS des billets

Rechercher sur pwet.fr

À retenir

Derniers commentaires

Archives

Nuage de tags

Bioutifoul photos

Quelques liens

Licence d'utilisation

Contenu sous Licence Creative Commons By-Sa

Sauf mentions spécifiques, les billets et les photos publiés sur ce site sont placés sous la licence Creative Commons by-sa.

Pour toute utilisation dépassant le cadre de cette licence, merci de me contacter par e-mail.