Posted by Will | Posted on 17-10-2009
I would like to write in english on this website, it's now done. This first post deals with JavaScript and asynchronous request (AJAX) to make the Facebook effect at the bottom of the timeline. An automatic process updates the timeline with old friend status when we reach the bottom of the page.
This process is pretty cool and i would like to get a similar stuff on my website. In theory, we just have to get scroll positions and page height. Once we get these values, we have to determine where we are in the page. If we reach the bottom, an asynchronous request gets old posts and we just have to display them below.
I chose to attach an event listener on the scroll event. I used this code :
if(window.addEventListener)
window.addEventListener("scroll", changePager, false);
else if (window.attachEvent)
window.attachEvent("onscroll", changePager);
else window.onscroll = changePager;
Posted by Will | Posted on 19-06-2009
Après avoir regardé une excellente conférence d'Eric Daspet sur l'amélioration des performances d'un site web j'ai appliqué les conseils et bonnes pratiques (Yahoo notamment) sur mon propre site. Résultat assez satisfaisant mais encore perfectible, je suis en grade B ou A si je désactive les appels FeedBurner et Twitter (très longs).
Pour commencer, j'ai passé un coup de smush.it sur mes images qui étaient déjà bien optimisées. Puis j'ai configuré mon cache Apache et les temps d'expiration. J'ai déporté le JavaScript qui n'était pas déjà en bas de page. J'ai configuré les ETags et activé la compression gzip. Pas de minimisation des CSS et JavaScripts, pas de gain de temps grâce à ce que vais présenter ensuite. Puis pour terminer j'ai commencé à optimiser le nombre de requêtes HTTP.
Pour cela j'ai appliqué la technique du combo handler de Yahoo.
[Ajout d'un complément graphique et d'un conclusion le 23/06/2009]