background preloader

Performances web

Facebook Twitter

Inline <script> and <style> vs. external .js and .css — what’s the size threshold? When is it acceptable to use inline <script> elements? When is it better to use separate .js files? The same question can be asked about inline vs. linked CSS — where do you draw the line? I had been pondering about this for a while, but while writing my post about optimizing the asynchronous Google Analytics snippet I was reminded I didn’t have a solid answer to my question yet. Is it worth it to separate the Analytics snippet into a separate .js file, so it can be cached? Obviously, I wasn’t gonna figure it out by myself. Here’s what Kyle said (emphasis mine): I’d say the threshold for me on ‘size’ would be around 400–600 bytes, or approximately 6–8 lines of JavaScript code.

Billy raised some interesting points as well (again, emphasis mine): The first thing to keep in mind is we are talking about approximately 320 bytes. Conclusion.

Scalable distributed computing/storage

Add Caching to a Data Access Layer. Dynamic web pages are great; you can adapt the resulting page to your user, show other user's activity, offer different products to your customers based on their navigation history, and so on. But the more dynamic a website is, the more database queries you'll probably need to perform. Unfortunately, these database queries consume the largest portion of your running time. In this tutorial, I will demonstrate a way to improve performance, without running extra unnecessary queries. We'll develop a query caching system for our data layer with small programming and deployment cost. 1. Adding a caching layer transparently to an application is often difficult because of the internal design. In this tutorial, we set our starting point in an application that performs all its database access through a centralized class from which all data models inherit the basic database access methods.

Let's implement it step by step. We connect to the database using the PDO library. 2. The Caching Basics 3. 4. The SMAQ stack for big data. “Big data” is data that becomes large enough that it cannot be processed using conventional methods. Creators of web search engines were among the first to confront this problem. Today, social networks, mobile phones, sensors and science contribute to petabytes of data created daily. To meet the challenge of processing such large data sets, Google created MapReduce.

Google’s work and Yahoo’s creation of the Hadoop MapReduce implementation has spawned an ecosystem of big data processing tools. As MapReduce has grown in popularity, a stack for big data systems has emerged, comprising layers of Storage, MapReduce and Query (SMAQ). Though dominated by Hadoop-based architectures, SMAQ encompasses a variety of systems, including leading NoSQL databases. MapReduce Created at Google in response to the problem of creating web search indexes, the MapReduce framework is the powerhouse behind most of today’s big data processing. Using MapReduce to solve problems entails three distinct operations: Hive.

Progressive rendering via multiple flushes. 2010 update: Lo, the Web Performance Advent Calendar hath moved 10/2011 update: You can also read the web page with Romanian translation (by Web Geek Science) Dec 21 This post is part of the 2009 performance advent calendar experiment. Stay tuned for the articles to come. Perceived page loading time is just as important as the real loading time. Using multiple content flushes allows you to improve both the real and the perceived performance. The head flush() While your server is busy stitching the HTML from different sources - web services, database, etc - the browser (and hence the user) just sits and waits. <html><head><title>the page</title><link rel=".. " href="my.css" /><script src="my.js"></script></head><? Doing something like this will result in shorter waterfalls, because more downloads can happen in parallel. One step further - multiple flushes While having the browser busy is good and the whole page loads faster, can we do better?

Here's an example - Google search results. Do it! Web Performant WordPress | daverupert.com. On Episode 4 of the ATX Web Show, I interviewed Kyle Simpson and we discussed Web Performance and Google’s plan to “Make the Web Faster”. Since then, Google has announced they will start rewarding your site’s page speed and they hint that the bar is set at ~1.4 seconds. I was thunderstruck. We always strive for better, but I typically found a 3-5 (even 7) second page load great. Late that night, I stayed up a few hours fiddling with The ATX Web Show and increased site performance by ~500%1. Since seeing those results, I see the web in milliseconds now. 5 Steps to a Faster Website I documented the steps I took to increase my YSlow and Page Speed grades without getting into costly CDNs and such. Step 0: Install the Right Tools. Webkit Web InspectorYou’ll need to download Chrome or Safari and then enable Web Inspector.

Step 1: Minify & Optimize Your CSS This is just a 3 step process and it’s here that I saw the majority of the site’s weight drop off. Minify CSS Don’t Over Qualify. SpriteMe. Un tutoriel de la mise en cache pour les auteurs Web et les webmestres. For Web Authors and Webmasters This is an informational document. Although technical in nature, it attempts to make the concepts involved understandable and applicable in real-world situations. Because of this, some aspects of the material are simplified or omitted, for the sake of clarity.

If you are interested in the minutia of the subject, please explore the References and Further Information at the end. What’s a Web Cache? A Web cache sits between one or more Web servers (also known as origin servers) and a client or many clients, and watches requests come by, saving copies of the responses — like HTML pages, images and files (collectively known as representations) — for itself. There are two main reasons that Web caches are used: To reduce latency — Because the request is satisfied from the cache (which is closer to the client) instead of the origin server, it takes less time for it to get the representation and display it. Kinds of Web Caches Browser Caches Proxy Caches Gateway Caches. High Performance Web Sites :: Velocity: Forcing Gzip Compression. Tony Gentilcore was my officemate when I first started at Google.

I was proud of my heritage as “the YSlow guy”. After all, YSlow was well over 1M downloads. After a few days I found out that Tony was the creator of Fasterfox – topping 11M downloads. Needless to say, we hit it off and had a great year brainstorming techniques for optimizing web performance. During that time, Tony was working with the Google Search team and discovered something interesting: ~15% of users with gzip-capable browsers were not sending an appropriate Accept-Encoding request header. As a result, they were sent uncompressed responses that were 3x bigger resulting in slower page load times.

Tony is now working on Chrome, but the discovery he made has fueled the work of Andy Martone and others on the Google Search team to see if they could improve page load times for users who weren’t getting compressed responses. The savings are significant. Performance web | Quelques mots pour des sites web rapides. PunyPNG - PNG Compression and Image Optimization - Gracepoint After Five. Cours Performance Web - Optimisation Temps De Chargement. 70 Expert Ideas For Better CSS Coding - Smashing Magazine. Advertisement CSS isn’t always easy to deal with. Depending on your skills and your experience, CSS coding can sometimes become a nightmare, particularly if you aren’t sure which selectors are actually being applied to document elements.

An easy way to minimize the complexity of the code is as useful as not-so-well-known CSS attributes and properties you can use to create a semantically correct markup. We’ve taken a close look at some of the most useful CSS tricks, tips, ideas, methods, techniques and coding solutions and listed them below. We also included some basic techniques you can probably use in every project you are developing, but which are hard to find once you need them. And what has come out of it is an overview of over 70 expert CSS ideas which can improve your efficiency of CSS coding. You might be willing to check out the list of references and related articles in the end of this post. Update (29/05/2007): Brazilian-Portuguese translation of the article2 is also available.

Minify - Project Hosting on Google Code. News 2013-07-23 Minify 2.1.7 is released in response to a serious vulnerability discovered in all previous versions. You are strongly urged to follow the instructions in the report to secure your installation, and to upgrade to Minify 2.1.7. 2013-07-19 Minify 2.1.6 released. This fixes several JSMin bugs. Check the history for more details. About Minify is a PHP5 app that helps you follow several of Yahoo! ' It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers.

Support List Minify in Use The stats above are from a brief walkthrough which shows how easy it is to set up Minify on an existing site. The design is somewhat similar to Yahoo's Combo Handler Service, except that Minify can combine any local JS/CSS files you need for your page. Minify integrated into other Projects/Plugins Features Requirements Installation See the UserGuide. Support List PHP5 Component Classes Warnings Problem Domain. YUI Compressor. According to Yahoo! 's Exceptional Performance Team, 40% to 60% of Yahoo! 's users have an empty cache experience and about 20% of all page views are done with an empty cache (see this article by Tenni Theurer on the YUIBlog for more information on browser cache usage).

This fact outlines the importance of keeping web pages as lightweight as possible. Improving the engineering design of a page or a web application usually yields the biggest savings and that should always be a primary strategy. With the right design in place, there are many secondary strategies for improving performance such as minification of the code, HTTP compression, using CSS sprites, etc.

In terms of code minification, the most widely used tools to minify JavaScript code are Douglas Crockford's JSMIN, the Dojo compressor and Dean Edwards' Packer. Documentation: Detailed description of the YUI Compressor and how to use it. How does the YUI Compressor work? Using the YUI Compressor from the command line Additional notes. CSS Tip: Preloading Images With CSS. CSS Tip: Preloading Images With CSS by Larisa Thomason, Senior Web Analyst, NetMechanic, Inc.

Web site visitors hate to wait, so many Web designers preload images to speed up page display. Although JavaScript is the most common way to preload images, it isn't your only option. Consider using the CSS DISPLAY property instead. It may be more reliable and it requires less complex code. New Issues With JavaScript Our June 2000 article discusses (in detail) how to preload images using JavaScript.

Preloading with JavaScript is a valuable technique! Your main problem used to be dealing with old browsers that didn't support JavaScript. Disabling JavaScript does protect users from the bad aspects, but it also deprives them (and you) of the benefits. Identify Slow Or Problem Pages Fortunately, Cascading Style Sheets (CSS) offer you an easy and reliable option. Consider this scenario: You run your own Web site that advertises your Poodle breeding and boarding service.

Why? Css - optimisateur. Highly Maintainable, Efficient, and Optimized CSS. 10 petits tests pour mettre votre site à l’épreuve. Le problème du web marketing, c’est qu’il est difficile de s’auto critiquer. Une fois un site finalisé, rares sont les webmasters qui arrivent à garder toute leur objectivité. Ainsi, on ne sait pas toujours où regarder ou comment améliorer son site.

C’est pour cela que je vous propose aujourd’hui une liste de 10 petits tests que vous pourrez tout à fait réaliser afin de vous assurer que votre site répond aux critères élémentaires de web design, d’ergonomie ou de web marketing de manière générale. (1) Votre site est-il suffisamment rapide ? C’est à cette question que Pingdom vous propose une réponse précise et détaillée. Intéressant, surtout lorsqu’on sait que les internautes n’aiment pas perdre leur temps et que la moindre milliseconde a son importance. Superbibi, mauvais élève du temps de chargement Sachez qu’il existe un module Firefox qui analyse également les temps de chargement, appelé Yslow, ou encore Firebug dans une moindre mesure. (2) Devenez client (3) Découpez votre logo. High Performance Web Sites and YSlow. Speeding Up Websites With YSlow. We all know there are countless reasons why web page load-times skyrocket, however, pinpointing the problem may be costly in both time and money.

So why waste the effort when someone else—or something else—can do all the dirty work for you? Meet Yahoo's YSlow, a free web page analyzer for Firefox. Getting Started YSlow has two requirements: YSlow piggybacks onto Firebug, so you will need to install the add-ons in the order listed above before continuing. The Problem Web designers, developers and copywriters strive to have the most unique and interesting content when compared to their competitors. You may have spent days perfecting your new blog post and nearly fallen off your chair with excitement when viewing it for the first time. The Solution: Yahoo's YSlow for Firefox Website analysis tools generally fall into two categories: Search engine optimization Analysis of the Document Object Model's (DOM) performance.

YSlow fits into the latter. There are three views: Grade ComponentsStatistics. 1. Velocity 2010: Nicole Sullivan, "The Top 5 Mistakes of Massive CSS" 5 Mistakes of Massive CSS.