Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coupe WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Comment installer et configurer W3 Total Cache pour les débutants

Note éditoriale : Nous percevons une commission sur les liens des partenaires sur WPBeginner. Les commissions n'affectent pas les opinions ou les évaluations de nos rédacteurs. En savoir plus sur Processus éditorial.

Vous souhaitez installer et configurer W3 Total Cache sur votre site WordPress ?

W3 Total Cache est une extension de mise en cache WordPress populaire qui vous aide à améliorer la vitesse et les performances de votre site. Les plugins de mise en cache peuvent aider à retenir les utilisateurs/utilisatrices et à réduire les taux de rebond, ce qui peut aider le référencement et augmenter les conversions.

Dans ce guide pour débutants, nous allons vous afficher comment installer et configurer facilement W3 Total Cache sur votre site WordPress.

W3 Total Cache installation and setup guide for WordPress beginners

Note de l’éditeur : Nous n’utilisons plus W3 Total Cache sur notre site et sommes passés à WP Rocket qui est une extension de mise en cache premium. W3 Total Cache reste une excellente solution qui fonctionne bien.

Qu’est-ce que W3 Total Cache ?

W3 Total Cache est l’une des meilleures extensions de mise en cache WordPress qui vous permet d’améliorer facilement les performances et la vitesse de WordPress.

Par défaut, WordPress utilise PHP pour générer dynamiquement chaque page de votre site lorsqu’elle est demandée par un compte.

PHP est un langage de programmation côté serveur. Cela signifie que chaque demande des utilisateurs/utilisatrices augmente la charge de votre serveur. Cela affecte les performances de votre site, l’expérience de l’utilisateur et le référencement.

Les plugins de mise en cache WordPress vous aident à réduire ce problème en passant à PHP et en servant une copie en cache de votre page web.

How caching works

Il vous permet également de connecter facilement votre site à un CDN (réseau de distribution de contenu) afin d’améliorer encore les performances de votre site.

Programme d’installation de W3 Total Cache dans WordPress

Avant d’installer le plugin W3 Total Cache dans WordPress, vous devez vous assurer que vous avez désactivé toute autre extension de mise en cache sur votre site. Cela vous aidera à enregistrer les ressources du serveur et à éviter tout conflit d’extension.

Ensuite, vous pouvez installer et activer l’extension W3 Total Cache. Pour plus de détails, consultez notre guide étape par étape sur l’installation d’une extension WordPress.

Une fois activé, W3 Total Cache ajoutera un nouvel élément de menu libellé Performance à votre colonne latérale d’administration WordPress. En cliquant dessus, vous lancerez l’assistant de configuration du plugin.

W3 Total Cache set up

Il suffit de cliquer sur le bouton « Suivant » pour continuer.

Il vous sera d’abord demandé d’activer la mise en cache de la page. Cliquez sur le bouton Tester le cache de la page pour continuer.

Configure page cache

W3 Total Cache vous affichera différentes options de moteur de stockage. Vous devez choisir celui qui vous fait gagner le plus de temps. En général, il s’agit de l’option « Disk : Amélioré  » pour la plupart des plateformes d’hébergement mutualisé.

Cliquez sur le bouton Suivant pour continuer.

Vous avez maintenant la faculté de tester la mise en cache de la base de données. Nous vous recommandons de choisir Aucun. Pour la plupart des sites de petite ou moyenne taille, votre serveur MySQL sera en mesure de récupérer les données plus rapidement que le cache de la base de données.

Database cache

Cliquez sur le bouton Suivant pour passer à l’étape suivante.

Vous accéderez ainsi à la section Mise en cache d’objets. La mise en cache d’objets permet à W3 Total Cache de stocker les requêtes de base de données pour les pages dynamiques et de les réutiliser pour améliorer les performances.

Object cache in W3 Total Cache

Si le résultat du test affiche une différence d’à peine quelques millisecondes, vous pouvez choisir Aucune.

Cliquez sur le bouton suivant pour continuer.

Ensuite, cliquez sur le bouton Tester le cache du navigateur, puis sélectionnez l’option « Activé » sous les résultats du test.

Browser cache

Cette option demande au navigateur de l’utilisateur de stocker une copie de la page web pour une durée limitée. Le chargement d’une page à partir de la mise en cache d’un navigateur est beaucoup plus rapide que le chargement à partir de la mise en cache de votre serveur web.

Cliquez sur le bouton suivant pour passer à l’étape suivante.

Dernier point, l’assistant de configuration vous demandera d’activer le chargement paresseux pour les images.

WordPress est désormais doté d’une fonction intégrée de chargement paresseux des images. Cependant, certains navigateurs plus anciens peuvent ne pas avoir de support pour cette fonctionnalité.

W3 Total Cache utilise JavaScript pour ajouter un chargement paresseux pour les images, ce qui peut être encore plus rapide et plus efficace.

Enable Lazy Loading

Ensuite, cliquez sur le bouton Suivant pour terminer l’assistant de configuration et voir le tableau de bord de W3 Total Cache.

Options de mise en cache avancées dans W3 Total Cache

Les réglages de base conviennent à la plupart des sites. Cependant, il existe de nombreuses options avancées que vous pouvez configurer pour améliorer encore les performances.

Passons en revue les plus importantes d’entre elles.

Minification de JavaScript et CSS dans W3 Total Cache

Le terme « minifier » est utilisé pour décrire une méthode qui permet de réduire la taille des fichiers de votre site. Pour ce faire, il retire les espaces blancs, les lignes et les caractères inutiles du code source.

Note: La réduction des fichiers JS et CSS peut potentiellement endommager votre site. Si vous l’activez et que votre site n’a pas l’air correct, désactivez simplement ces options.

W3 Total Cache vous permet de minifier facilement le code source JavaScript, CSS et HTML. Cependant, nous recommandons de minifier uniquement les fichiers JavaScript et CSS.

Il suffit de se rendre sur la page Performance  » Minify et de défiler jusqu’à la section JS.

Enable JS minify in W3 Total Cache

Cochez la case située à côté de « JS minify settings » pour l’activer.

Défilez maintenant jusqu’à la section CSS et activez les réglages de minification CSS de la même manière.

Enable CSS minify

N’oubliez pas de cliquer sur le bouton Enregistrer tous les réglages pour stocker vos réglages.

Pour d’autres méthodes, consultez notre guide sur la façon de minifier les fichiers JavaScript et CSS dans WordPress.

Activer le support CDN dans W3 Total Cache

Les réseaux de distribution de contenu (CDN) vous aident à améliorer les performances de votre site en diffusant des fichiers statiques tels que des images, des feuilles de style CSS et du JavaScript à partir d’un réseau mondial de serveurs.

Cela permet de réduire la charge sur le serveur de votre hébergeur WordPress et d’améliorer la vitesse de chargement des pages.

W3 Total Cache est livré avec un support intégré pour diverses plateformes CDN.

Nous recommandons d’utiliser Bunny.net qui est la meilleure solution CDN sur le marché. C’est ce que nous utilisons pour notre site OptinMonster.

Tout d’abord, vous devez vous inscrire pour obtenir un compte Bunny.net. Après l’inscription, vous devez créer une Zone Pull pour votre site.

Bunny CDN dashboard

Une zone pull ajoute un nom d’hôte au CDN de Bunny.net. Ce nom d’hôte est ensuite utilisé pour servir les fichiers statiques de votre site.

Ajoutez un nom pour votre zone pull et indiquez ensuite le nom de domaine de votre site.

Create pullzone

Après avoir ajouté la pullzone, vous devez vous rendre sur la page Performance  » Réglages généraux.

Ensuite, défilez vers le bas jusqu’à la section CDN.

Enable CDN

Cochez la case Activer en regard de l’option CDN et choisissez Miroir générique en regard de l’option Type de CDN.

N’oubliez pas de cliquer sur le bouton Enregistrer toutes les modifications pour stocker vos réglages.

Ensuite, vous devez visiter la page Performance  » CDN et défiler jusqu’à la section Configuration : Objets.

Add CDN hostname

À partir de là, vous devez ajouter le nom d’hôte que vous avez créé plus tôt pour votre pullzone et cliquer sur le bouton tester le miroir.

W3 Total Cache vérifiera la disponibilité de votre nom d’hôte et affichera le message Test Passed en cas de réussite.

Vous pouvez maintenant cliquer sur le bouton Enregistrer toutes les modifications pour stocker vos réglages.

W3 Total Cache va maintenant commencer à servir vos ressources statiques à partir du serveur CDN.

W3 Total Cache fonctionne également très bien avec le CDN gratuit de Cloudflare. Version, vous pouvez également l’utiliser avec Sucuri qui est le meilleur service de pare-feu de site avec service CDN intégré.

Dépannage des problèmes liés à W3 Total Cache

Une fois que vous avez configuré W3 Total Cache correctement, il devrait fonctionner de manière transparente en arrière-plan pour améliorer la vitesse de WordPress et booster les performances.

Il peut arriver que vous ne voyiez pas immédiatement les modifications que vous avez apportées à votre site ou qu’une extension ne fonctionne pas correctement.

La raison la plus fréquente de ces problèmes est que vous voyez probablement une ancienne version en cache de votre site.

Ce problème peut être facilement corrigé en vidant le cache de WordPress.

Il vous suffit de cliquer sur le menu Performance en haut de la page, puis de sélectionner l’option Purger tout cache. W3 Total Cache effacera tous les contenus mis en cache sur votre site.

Clear all cache in W3 Total Cache

Si vous voyez toujours l’ancienne version de votre site, essayez également de mettre en cache votre navigateur.

Nous espérons que cet article vous a aidé à installer et à configurer W3 Total Cache sur WordPress. Vous pouvez également consulter notre guide complet de sécurité WordPress pour les débutants afin de renforcer la sécurité de votre site web, ou nos choix d’experts des meilleurs services d’hébergement WordPress pour accélérer encore plus votre site.

Si vous avez aimé cet article, veuillez alors vous abonner à notre chaîne YouTube pour obtenir des tutoriels vidéo sur WordPress. Vous pouvez également nous trouver sur Twitter et Facebook.

Divulgation : Notre contenu est soutenu par les lecteurs. Cela signifie que si vous cliquez sur certains de nos liens, nous pouvons gagner une commission. Consultez comment WPBeginner est financé, pourquoi cela compte et comment vous pouvez nous soutenir. Voici notre processus éditorial.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

L'ultime WordPress Toolkit

Accédez GRATUITEMENT à notre boîte à outils - une collection de produits et de ressources liés à WordPress que tous les professionnels devraient avoir !

Reader Interactions

163 commentairesLaisser une réponse

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Manolis says

    hi,
    how i can restore my settings to default? how i can restore the redirect of cdn.mydomain.com to my default domain name???

  3. WPBeginner Staff says

    You can add your shopping cart page as an exception in w3 total cache. Under Performance > Page Cache scroll down to advanced section where you will find the option ‘Never cache the following pages’. For example, if your eCommerce plugin uses a page cart for checkout, then simply enter “cart/” to exclude that page or “cart/*” to exclude that page and all sub-pages. (Without the quotes, of course.)

  4. Marou Wing says

    Hi Guys, thank you for the awesome article, it made my site much faster than before! However I have encountered with a little issue. My site has webshop and the checkout page (due to the Credit Card payment option) has https (I have my own SSL hosted by RapidSSL). So the checkout page (I assume because of the SSL is totally messed up when the W3TotalCache is enabled, no formats, no pictures, no colours only text…) How can I fix this issue, do you have any recommendation? Thank you, Marou

  5. WPBeginner Staff says

    We haven’t noticed any significant conflicts on any of our websites where we use it. Even then, if you come across a conflict then notify the plugin author by using the support tab on the plugin’s page.

  6. adeem jan says

    Thanks for writing this tutorial on how to setup and decrease a blog load time using W3 total cache.

    I use this same plugin on one of my blogs, the resulting speed of the blog is awesome.

    Although, i have seen many people complain about this plugin that it sometimes conflict with other wordpress plugins.

    I don’t know if you have experienced this in person?

  7. Roger Phillips says

    Hi thanks for the video I enjoyed it, I’ve used w3 total cache for over 5 years on all four of my personal sites and I honestly have to say I’ve alway had better luck 90% of the time using it right out of the box, less likely to break other function that way. Kind of the risk vrs rewards factor and that normally persuades me to just use it out of the box. After watching this video and decided to give the settings you requested a try, You helped me out quite a bit. My site went up in speed from 82% to 97% page speed, and yslow score went from 72% to 93%, thanks for the setting can’t wait to try them on my other sites!
    Fish

  8. Arif Ahmed says

    I used W3 cache through my developer. My site was acting weirdly, it does not load properly on first instance and when I refresh the page it is loaded properly. This happens with every page. When I told my developer, he told me that it because my internet speed is slow and the page is not able to serve from cache. So why is this happening ? Any clue

  9. Rachael says

    Like the previous person Ss, I am new to WP and I followed this plugin tutorial video (aside from the minify, CDN stuff). I got the same message at the top of my pages in wp admin: « The setting change(s) made either invalidate the cached data or modify the behavior of the site. now to provide a consistent user experience.  » Why did this happen and Should I dismiss it or click on the empty cache button? Help, Please!

  10. imssarl says

    I installed that way, but my site design is all messed. I have my blog installed on a subdomain: blog.mydomain.com ; what should I set for the cdn? cdn.blog.mydomain.com?

  11. Salud Casera says

    I followed the instructions for beginners and all it tooks was three clicks to set it all up (if you are not using CDN). It would be good to have a more advanced version of this post.

    Edit : After testing for speed, it only made my website slower.

  12. bemed says

    I mean I installed W3 Total Cache on the Network Admin but it does not show on the website that I want it to be active.
    Does it handles multi-site installations or it only works individually?

  13. Kristine says

    Hi, thank you for the tips! I read on some blog, they check all the setting (minify, database cache, etc) without explain what the function does..

    Just setup my w3 today :)

  14. Ashutosh Bhardwaj says

    Hi, This was a great step guid, well i was searching something like disabling w3tc adding query string to my images inserted in post. Actually it breaks the lightbox effect. There seems to be not an option on panel
    Anyway Gud Post

  15. Ss says

    Thanks for this tut, I’m pretty new to wp and all this helps a great deal! I installed and activated this plugin as per your post (aside for the CDN part). However the following message appears at the top of all pages in wp admin: « The setting change(s) made either invalidate the cached data or modify the behavior of the site. now to provide a consistent user experience.  »
    Should I dismiss this or click on the empty page cache button?

  16. Craig says

    Very helpful post! Been using W3TC for quite awhile, but configuring a CDN can be a little tricky. This guide made it a breeze. Thank you! :)

  17. Fauzul says

    Luckily found this short tutorial, my blog page load increased severely after setting up the caches. Now I know better what to turn on and what cache to leave disabled. On shared hosting, in my opinion it’s only good to turn on page cache and browser cache.

    Now going to try it with a CDN. Hopefully things can improve further.

  18. Susan says

    Hi,

    I using a wp multi site install and Cloudflare but I just cannot find any instructions on how to configure W3.

    When activated network wide there is nowhere to add individual distributions for each sub domain.

    Or else I’m missing something!

    Any help is much appreciated

    cheers

  19. Sharon says

    Awesome article! Just what I was looking for – my site is on Hostgator and I’d love to use both W3 Total Cache and Max CDN. Perfect.

    BUT I got lost at the point of creating subdomains. I just don’t understand what that means or how to create one. Just make one up? Find one somewhere on my site. Very confused.

    My site is slow – it gets a C at best on GTMetrixs, and I’m preparing to do a big campaign. I need help.

    Do ya’ll offer support services? I saw that you do free blog set ups. Would accept payment to help set these up for me?

    Sharon

  20. Zubair says

    Hi ! its a nice plugin . but i installed WP Fastest cache instead , so now i am facing a little problem with this . i have used contact form 7 with really simple captcha but after installing the WP Fastest Cache the captcha image is broken in the website. so how to get rid of this or if i install w3tc will i overcome this problem.

    Regards

    Zubair

    • Ashutosh Bhardwaj says

      That might be the reason, because in order to make everything cachable, ur plugin might have added a query string as suffix to image name, and it broke.
      Ask plugin support, they will help for sure

  21. Philip Verghese Ariel says

    Hi Admin & Syed Balkhi.
    What a pleasant land here.
    I am really in search of such a page
    since I am new to this platform called WP :-)
    Recently i created (migrated) my blogger page here with the help of one of my blogger friends. Now I am here via Arun’s page here at WP, and found this place is a good place for a WP beginner like me :-) I think this looks like a bit advanced page to me, so i am going
    to your Archives WPBEGINNER ARCHIVES » to find some basic lessons :-)
    Anyways I will be here to look and study around :-)
    Thanks a lot for all your efforts to put these lessons in a systematic way.
    I am bookmarking this page.
    Have a wonderful time.
    Best Regards
    Philip

  22. Alex says

    thanks guys for your awesome job.

    In the dashboard W3 gives a tip to upgrade to Pro for $99. However all the functions you described can be checked without upgrade.

    Then what this upgrade is for? – should i go ahead and purchase the upgrade?

  23. Carla says

    I’ve been trying to set up this plugin for ages. I just left the default settings and it was very helpful. Now that I have additional settings checked, my site is super speedy. Thanks so much! I did not set the CDN though because I have ClourFlare enbaled.

  24. David Geer says

    I am at the step where I configure the CDN section in W3TC. I added cdn.davidgeer.com and clicked add cname. It added it and said it was reserved for CSS. Then another field popped up to add another CNAME and it said it is reserved for js in . Should I keep adding each of my consecutive cnames to the available cname fields that pop up here in W3TC and then save settings?

      • Adam Lindsey says

        I seem to be having an issue as well. There is the long CNAME url.url.netdna.cdn.com that works, but if I use the cdn.tnmedia.com, cdn1.tnmedia.com, etc. It doesn’t work. Isn’t it better to have JS files pulling form one subdomain and have another pulled form a different one or am I way off base here?

  25. Joe DeCaro says

    I love your site. I installed W3TC and set it up as you suggested. I’m on shared hosting. Now that it is installed, I’m getting emails from readers saying they can’t see our latest posts as they go up.

    Did I do something wrong?

    I set the browser cache settings step by step as you advised.

    What may have cause this new issue for my readers since installing the W3?

    Thanks.

    My site is MetsmerizedOnline.com

  26. Osnilton Mozarino says

    Thanks for the great article!!! As usual very well written and informative.
    Question: I now have a pretty clear idea about CDN, however for a regional or national only web site, will it still be benefitial to use it, as the hosting server(s) are already in the main cities, say close enough? As it seems to be a great thing for international web sites.
    Thank you

  27. Himanshu Goel says

    Hey I have tried installing and managing with this plugin and I don’t own a cdn. do this plugin works with cdn better or we can try some extra efforts in settings to make this work better without cdn.

    Should we actually use caching plugin if we are not running up with cdn services (I am involving every cache plugin)

  28. Zalmey says

    My Question is that, will I get better performance from W3TC without MaxCDN & CloudFlare. Does anyone using it with these 2 and having a good load time?

    • avgjoegeek says

      If setup properly? W3TC/MaxCDN and Cloudflare can significantly speed up your website.

      I used W3TC to configure to use MaxCDN. Then did a manual install for CloudFlare, You don’t need to configure it within W3TC. And it is fast… very fast once it’s all setup!

  29. Andy Crichton says

    Great article. I know just about enough to get myself in trouble, so I did ask the MaxCDN guys a lot of questions before and during setup. I asked a couple of times about the subdomains, I said it sounds cool and logical to have the 4 extra to serve certain files « instantly » – they said the difference in delivery is almost non existent, like 10ms. So I havent bothered. Have you really seen a significant difference with / without the 4 subdomains at work?

    thanks

    PS I didnt know about your affiiation before I signed up to MaxCDN, but anyone reading, wow, the company is brilliant! There was an issue with my forum plugin – when the CDN was installed, the theme broke if you did a quote, and also members couldnt login. MaxCDN analysed it and I gave them admin access and they sorted it. Also the delivery of the site (hosted in Colorado) now in Europe is down from 4 secs to 1.5 according to pingdom.

  30. Sherif says

    Hi,

    Thanks for your time writing this, it is very helpful and i setup W3TC but after that i started getting a strange error about database connection lost every time i try to post new post or edit and existing one,any clue what should i do or where to start looking around

    If i disabled the plugin, this error message is not showing any more and i am able to post normally

    Sherif

  31. Donna Caissie says

    I installed Total Cache several weeks ago, and since then, using my backend has been a nightmare. Every time I tried to do anything in the backend, my browser (Firefox) would hang. I finally deactivated Total Cache today, and now my backend works just ducky.

  32. Hayslan says

    Hey guys, what do you think of leaving somewhere in the post – maybe at the end, a ‘log’ of what section / topic went updated?

    A long time ago I read this article and now for example I have no idea at what point it went updated.

    Would not it be helpful? Let me know!

  33. Steve says

    I’ve tried several times to install caching plugins (both W3 Total Cache and WP Super Cache) and in every case, my overall site performance takes a major hit as soon as the plugin is activated/configured.

    This time, I followed the instructions to the letter as shown above. However (as has occurred in every other time I’ve tried), load time throughout the site has at least tripled.

    The one thing I didn’t do in every case is get a CDN, due to the cost involved.

    So my question is this.. do the caching plugins only work in conjunction with a CDN?

    If so, is there any other way to speed up performance (aside from the obvious – removing plugins, etc). I use WP Optimize regularly.

  34. Abhisek says

    I am planning to go for maxCDN but, i have a dilemma that, i use a sub-domain to store all my media files something like this – media.example.com. As a result Wp-Smush it plugin no more works and i have to compress images myself using png-gauntlet software in windows. Will this sub-domain also create any problem in switching to maxCDN ?

  35. Jeremy Myers says

    First, where is your « after » screen shot from Pingdom? That « before » test was pretty dang good, and I am curious to see if it actually improved.

    Second, I have done a lot of testing between W3 Total Cache and WP Super Cache. I agree with W3 has more options and seems to be a better plugin, but with W3, my server response time nearly tripled! It went from about .25 seconds to almost a full second. Why is this?

    Third, what about Cloudflare integration? Any suggestions one way or the other?

    • Denise Blackman says

      Hi Jeremy. I don’t have the answer to the increased response time of your server with W3, but I had the same problem. Mine, however, was even more severe, with an increase to almost 1.25 sec. I wish someone could answer this. My host provider has no answer either. My personal guess is that the server that is hosting my account, which is a shared server, is over taxed. It is normally what happens when an account suddenly has major performance issues.

      In reference to CloudFlare, I have tried to integrate it, but had problems with my theme. I had to disable it. It made way too many changes to my CSS. I don’t know a lot about CloudFlare, and it sounded great. I just couldn’t figure out a way to make it work with my theme at all.

    • Alex says

      Dmitry,

      Due to localized business activity my website is set for a specific location, Moscow Russia. That said I don’t expect people from other cities to bother me. Do you think I still should go for the MaxCDN?

      Thanks

  36. Raghu says

    One more step for MaxCDN : Add noindex to cdn contents to prevent Google from indexing CDN contents which will create duplicate content issues.

    It’s under Zones > Pull zones > SEO

    Check enable and use custom robots (with default code for robots.txt)

    • Alex says

      Raghu,

      thanks for the heads-up. Do you mean I need to edit robots.txt or there are just default options that I need to check in Zones > Pull zones > SEO section?

      The necessity to touch robots.txt kind of scares me as I am not a coder.

      thanks

Laisser une réponse

Merci d'avoir choisi de laisser un commentaire. Veuillez garder à l'esprit que tous les commentaires sont modérés selon notre politique de commentaires, et votre adresse e-mail ne sera PAS publiée. Veuillez NE PAS utiliser de mots-clés dans le champ du nom. Ayons une conversation personnelle et significative.