A velocidade do site é crucial para a experiência do usuário, SEO e conversões. Um site lento pode frustrar os visitantes, levando-os a abandonar o site antes mesmo de terem a chance de explorar seu conteúdo. É por isso que usamos um plug-in de cache para manter a velocidade de nossos sites.
O W3 Total Cache é um plug-in de cache popular e poderoso para WordPress que pode melhorar consideravelmente o desempenho do seu site. Ele cria versões estáticas de suas páginas, reduzindo a carga do servidor e fornecendo conteúdo aos visitantes com muito mais rapidez.
Este guia amigável para iniciantes fornece instruções passo a passo para instalar e configurar o W3 Total Cache em seu site WordPress. Explicaremos os principais recursos e configurações para que você possa otimizar a velocidade do seu site e criar uma experiência mais suave e agradável para os seus usuários.
Nota do editor: Não usamos mais o W3 Total Cache em nosso site e mudamos para o WP Rocket, um plug-in de cache premium. O W3 Total Cache ainda é uma boa solução que funciona bem.
O que é o W3 Total Cache?
O W3 Total Cache é um dos melhores plug-ins de cache do WordPress que permite melhorar facilmente o desempenho e a velocidade do WordPress.
Por padrão, o WordPress usa PHP para gerar dinamicamente cada página do seu site quando ela é solicitada por um usuário.
O PHP é uma linguagem de programação do lado do servidor. Isso significa que cada solicitação do usuário aumenta a carga no seu servidor. Isso afeta o desempenho, a experiência do usuário e o SEO do seu site.
Os plug-ins de cache do WordPress ajudam a reduzir esse problema, ignorando o PHP e fornecendo uma cópia em cache da sua página da Web.
Ele também permite que você conecte facilmente seu site a uma CDN (rede de distribuição de conteúdo) para melhorar ainda mais o desempenho do site.
Instalação do W3 Total Cache no WordPress
Antes de instalar o plug-in W3 Total Cache no WordPress, é necessário certificar-se de desativar qualquer outro plug-in de cache no seu site. Isso o ajudará a economizar recursos do servidor e evitará conflitos de plugins.
Depois disso, você pode prosseguir e instalar e ativar o plug-in W3 Total Cache. Para obter mais detalhes, consulte nosso guia passo a passo sobre como instalar um plug-in do WordPress.
Após a ativação, o W3 Total Cache adicionará um novo item de menu chamado Performance à barra lateral de administração do WordPress. Ao clicar nele, será iniciado o assistente de configuração do plug-in.
Basta clicar no botão Next para continuar.
Primeiro, você será solicitado a ativar o Page Cache. Clique no botão Test Page Cache para continuar.
O W3 Total Cache mostrará a você diferentes opções de mecanismo de armazenamento. Você precisa escolher aquele que lhe poupará mais tempo. Normalmente, será a opção “Disk: Enhanced” para a maioria das plataformas de hospedagem compartilhada.
Clique no botão Next para continuar.
Agora, você terá a opção de testar o cache do banco de dados. Recomendamos escolher None (Nenhum). Para a maioria dos sites de pequeno e médio porte, o servidor MySQL poderá buscar dados mais rapidamente do que o cache do banco de dados.
Clique no botão Next para passar para a próxima etapa.
Isso o levará à seção Object Cache. O Object Caching permite que o W3 Total Cache armazene consultas ao banco de dados para páginas dinâmicas e as reutilize para melhorar o desempenho.
Se o resultado do teste mostrar uma diferença de apenas alguns milissegundos, você poderá escolher None (Nenhum).
Clique no botão seguinte para continuar.
Depois disso, clique no botão Test Browser Cache (Testar cache do navegador) e selecione a opção “Enabled” (Ativado) nos resultados do teste.
Essa opção solicita que o navegador do usuário armazene uma cópia da página da Web por um tempo limitado. Carregar uma página do cache do navegador é muito mais rápido do que carregá-la do cache do servidor da Web.
Clique no botão next para passar para a próxima etapa.
Por fim, o assistente de configuração solicitará que você ative o carregamento lento para imagens.
Agora, o WordPress vem com carregamento lento integrado para imagens. No entanto, alguns navegadores mais antigos podem não ter suporte para esse recurso.
O W3 Total Cache usa JavaScript para adicionar carregamento lento para imagens, o que pode ser ainda mais rápido e eficiente.
Depois disso, clique no botão Next (Avançar) para concluir o assistente de configuração e visualizar o painel do W3 Total Cache.
Opções avançadas de cache no W3 Total Cache
As configurações básicas funcionariam para a maioria dos sites. No entanto, há muitas opções avançadas que você pode configurar para melhorar ainda mais o desempenho.
Vamos dar uma olhada nas mais importantes.
Reduzindo JavaScript e CSS no W3 Total Cache
O termo “minify” é usado para descrever um método que reduz o tamanho dos arquivos do seu site. Ele faz isso removendo espaços em branco, linhas e caracteres desnecessários do código-fonte.
Observação: a redução dos arquivos JS e CSS pode danificar seu site. Se você ativá-la e seu site não parecer correto, basta desativar essas opções.
O W3 Total Cache também permite que você reduza facilmente o código-fonte JavaScript, CSS e HTML. Entretanto, recomendamos que você reduza apenas os arquivos JavaScript e CSS.
Basta acessar a página Performance ” Minify e rolar para baixo até a seção JS.
Marque a caixa ao lado de “JS minify settings” para ativá-la.
Agora, role para baixo até a seção CSS e ative as configurações de redução de CSS da mesma forma.
Não se esqueça de clicar no botão Save All Settings (Salvar todas as configurações) para armazenar suas configurações.
Para obter métodos alternativos, consulte nosso guia sobre como reduzir os arquivos JavaScript e CSS no WordPress.
Como ativar o suporte a CDN no W3 Total Cache
As CDNs ou redes de distribuição de conteúdo ajudam a melhorar ainda mais o desempenho do seu site, fornecendo arquivos estáticos, como imagens, CSS e JavaScript, a partir de uma rede global de servidores.
Isso reduz a carga no servidor de hospedagem do WordPress e melhora a velocidade de carregamento da página.
O W3 Total Cache vem com suporte integrado para várias plataformas CDN.
Recomendamos o uso do Bunny.net, que é a melhor solução de CDN do mercado. É o que usamos em nosso site OptinMonster.
Primeiro, você precisa se registrar em uma conta Bunny.net. Após o registro, é necessário criar uma Pull Zone para o seu site.
Uma pull zone adiciona um nome de host ao Bunny.net CDN. Esse nome de host é usado para fornecer arquivos estáticos para seu site.
Adicione um nome para sua pull zone e, em seguida, forneça o nome de domínio do seu site.
Depois de adicionar a pullzone, você precisa acessar a página Desempenho ” Configurações gerais.
Em seguida, role a tela para baixo até a seção CDN.
Marque a caixa Enable (Ativar) ao lado da opção CDN e escolha Generic Mirror (Espelho genérico) ao lado da opção CDN Type (Tipo de CDN).
Não se esqueça de clicar no botão Save All Changes (Salvar todas as alterações) para armazenar suas configurações.
Em seguida, você precisa visitar a página Performance ” CDN e rolar para baixo até a seção Configuration: Objects.
Aqui, você precisa adicionar o nome de host que criou anteriormente para a pullzone e clicar no botão test mirror.
O W3 Total Cache verificará a disponibilidade de seu nome de host e exibirá a mensagem Test Passed quando for bem-sucedido.
Agora você pode clicar no botão Save All Changes (Salvar todas as alterações) para armazenar suas configurações.
O W3 Total Cache começará a fornecer seus recursos estáticos a partir do servidor CDN.
O W3 Total Cache também funciona bem com a CDN gratuita da Cloudflare. Como alternativa, você também pode usá-lo com o Sucuri, que é o melhor serviço de firewall de site com serviço de CDN integrado.
Solução de problemas com o W3 Total Cache
Depois que você configurar o W3 Total Cache corretamente, ele deverá funcionar perfeitamente em segundo plano para melhorar a velocidade do WordPress e aumentar o desempenho.
Ocasionalmente, você pode se deparar com problemas em que não vê as alterações feitas em seu site imediatamente ou um plug-in pode não estar funcionando corretamente.
O motivo mais comum para esses problemas é que você provavelmente está vendo uma versão antiga em cache do seu site.
Isso pode ser facilmente corrigido limpando o cache no WordPress.
Basta clicar no menu Performance (Desempenho) na parte superior e selecionar a opção Purge All Caches (Limpar todos os caches). O W3 Total Cache limpará todo o conteúdo armazenado em cache em seu site.
Se ainda estiver vendo a versão antiga do seu site, tente também limpar o cache do navegador.
Esperamos que este artigo tenha ajudado você a instalar e configurar o W3 Total Cache no WordPress. Talvez você também queira ver nosso guia sobre como aumentar a velocidade de carregamento da página no WPBeginner e nossa seleção especializada dos melhores plug-ins de cache do WordPress para acelerar seu site.
Se você gostou deste artigo, inscreva-se em nosso canal do YouTube para receber tutoriais em vídeo sobre o WordPress. Você também pode nos encontrar no Twitter e no Facebook.
Rabia
Thanks valuable information.
WPBeginner Support
You’re welcome
Administrador
Jiří Vaněk
I would recommend everyone to make a note of the changes you have made, especially. Issues on the website may not manifest immediately. For instance, it happened to me that after a week, WordPress started behaving strangely, and it was happening randomly. It took me quite a while to find the problem in the cache plugin and incorrect settings. If I had documented the changes I made, I would have found the problem more easily. It’s a recommendation for everyone.
Roin
Hello,
I’ve a question:
Does a free version slow the website ? My opinion is that a free version of this plugin makes website slow.. how do you think?
WPBeginner Support
The free version of plugins will not slow down your site, poorly coded plugins can slow down your site.
Administrador
Abu Allaah
Thanks for the valuable tips,
I would like to ask if it’s possible to update the article with the latest version of the plugin.
Thanks in advance
WPBeginner Support
We will look into updating the article as soon as we are able
Administrador
Balu
I enabled Minify settings in W3 Total cache plugin and also installed cloudflare extension in w3 total cache plugin.
Should I enable minify settings in Cloudflare extension also?
WPBeginner Support
You would want to only use one or the other, if your W3 Total cache minification is working well then stay with that for the moment
Administrador
Prajyot Kumbharjuvekar
Do I still need to install a caching plugin if I use CLOUDFLARE CDN
WPBeginner Support
It is not required but it is recommended to use a caching plugin with your CDN
Administrador
Duryab
This post is much outdated now, please update this post to the latest W3 total cache plugin.
Thanks.
WPBeginner Support
Thank you for letting us know about this post being outdated, we will update this article as we are able
Administrador
Tom Lloyd
Thanks for the great article! I really benefitted from it and have a better performance now 1/4 load time. One thing you should mention is in the Browser Page under Performance tab there is a box at the bottom that says Rewrite URL. Don’t check that it ruined my pages. All links were alterred but I took it off and it’s ok.
Gavin
Thanks for your very easy to follow tutorial (with screenshots) on W3 Total Cache. I noticed an immediate difference in load time of the site.
Bikramjit
Hi, As per your recommendation, I have decided to go for MaxCDN, Is there any new update about CDN? Going to the MaxCDN site, there are different service including Content Delivery Network, Edge Delivery and other. Can your recommend me which service I have to select initially? I have new blog with no affiliate link till now and not planning for the next six month. And I am planning to apply Google adsense in the near future.Presently I installed WP Super Cache.
Do I need to switch W3 Total Cache to configure with MaxCDN? if I can configure MaxCDN with WP Super Cache, do you have any guideline?
HumbleHuman
Hey:)
Thanks for those detailed instructions and I must say that you helped me much in setting up W3TC for my website..
I have a small issue with W3TC.. It is not purging my feed cache even though I have enabled this in the Purge Policy..
Will you help me how to solve this issue?
Thanks in Advance
Brandon
After following this guide, I get the error: “Error: Empty hostname / CNAME list.” I have filled the “Replace site’s hostname with:” with all my cdn.* fields. Has anyone ran into this issue?
Vijay Prajapati
I am Using W3 Total cache plugin for WordPress. My post has one table which updates every minute/hour. But as I do caching, the server does not serves latest version, instead it displays cached copy to the visitor. How can I purge cache every 30 minutes automatically so that it shows latest version of the post at after every 30 minutes?
I have already tried inserting this code in functions.php file but its not purging cache every 1h, instead it dies 2-3h later.
function w3_flush_cache( ) {
$w3_plugin_totalcache->flush_all();
}
// Schedule Cron Job Event
function w3tc_cache_flush() {
if ( ! wp_next_scheduled( ‘w3_flush_cache’ ) ) {
wp_schedule_event( current_time( ‘timestamp’ ), ‘hourly’, ‘w3_flush_cache’ );
}
}
Anna
Thanks for such an easy to follow article. I broke my website yesterday using instructions from another blog. I should have come here first!!
I am a bit surprised by my results though. I did a Pingdom and GT Metrics test before I made all these changes and my page load time was:
Pingdom: 8.91 secs and GT Metrix: 5.3 secs
After I made all the changes I re-ran the tests:
Pingdom: 9.51 secs and GT Metrix: 9.9 secs
I thought my load times were meant to get much better – not worse!!?? What have I done wrong?
WPBeginner Support
Hi Anna,
Allow the plugin to generate cache and recheck your scores. If that doesn’t help try to review your cache settings to make sure everything is setup properly. Alternately, you can try WP Super Cache and see if it helps.
Administrador
Roman
Thank you for so great content.
Should I enable “Page cache” option in the process of development of site or only at when I launch it?
For me it is convenient to do this right now, but I think maybe during development it is not good as I visiting thousand times to check the progress.
WPBeginner Support
Hi Roman,
Yes, you are right. You can set up the plugin later once your website is live.
Administrador
Jessica Braboy
Hi! Trying to install the W3 Total Cache Plug In, and while it says it is compatible with my version of WordPress, it says that the plug in is unavailable and says “Not allowed on our system due to performance, security or compatibility concerns. Please contact support with any questions.”
First of all… do you know why this is no longer working? And, do you have an alternative cache plug in that you recommend? Thank you!
WPBeginner Support
Hi Jessica,
This means that your WordPress hosting company doesn’t allow the plugin. Most probably because they have their own caching solution integrated into your hosting account which doesn’t work well with W3 total Cache. Please contact your hosting provider for more details.
Administrador
Andy Sellers
Hi, I need some help please.
I’ve followed the instructions to serve my static files through CDN (and they’re very clear, thank you) and have found the process straightforward so far- but when I log in to my site the URL still starts with ‘www.’ and not ‘cdn’ so I guess cdn is not operational yet.
One thing I notice is that in the MAXcdn account page there is no option to ‘Update’ the Custom Domain settings as mentioned in the instructions – is this OK? I assume it now updates automatically?
But my main problem is that, assuming I now have to do this, I don’t know how to specify the static files in the custom files list in the custom setting of W3Total Cache. Help please. How should I fill in this Advanced panel – it’s now getting a bit too techie for me? Thank you.
WPBeginner Support
Hi Andy,
You will login to your WordPress site using the normal URL. CDN only serves static files via their network not the whole website.
MaxCDN settings may have changed, but you would still need to setup your domain. Please contact their support and they will be able to guide you.
Administrador
sazia kazia
Hi Very helpful and useful article. I set w3 total cache as per above instructions and could see it improved my website speed in good level. I ‘ll use MaxCDN instructions …Thank you so much
Amit Jain
Hello Team! I am following your blog since long now and trust have learnt a lot. Thanks.
I need a little bit of help – Mine is a startup site, but have started with Cloud VPS Server with Data Centre located in Mumbai, India. 2.80*4 CPU and 8GB Ram is the part of Server Configuration. For better Site Security and Performance what should i use – Cloudflare (If cloudflare then free or paid plan) or Sucuri, W3Total Cache, WP Super Cache, Varnish Cache or Some other plugin/software.
Francis
Good and Quality tutorial
thanks Syed Balkhi.
this really helped me
Raj singh
I have an issue with this plugin , when I trying to update this plugin it failed and after fails when I Refresh my wordpress site .
It says under maintenance come back after few hours.
So I leave and came back after few hours but after few hours when I try to open my site .
It’s Totally blank , Nothing is show on my Site.
Only white page comes when I Try to open.
So now what should I do ?
Please help me…
Derek C
Thank you so much! I was about to go pay an extra $15 a month for cloud based hosting because my blog had gotten so slow at times it was unbearable! I had setup W3 Total Cache and just enabled everything.
I didn’t recognize it until going through your guide, but this was the main reason my dashboard and WP console was taking FOREVER to do anything. Sometimes I would wait 20-30 seconds just to create or save a post. Now it is like 2-3 seconds at the max. Also, my site loads even faster with a lot of that junk turned off.
I am on a shared hosting plan, and I guess all of the caching was actually bottlenecking the CPU or something…. Anyhow, thanks for such a useful guide!
Huu
Thanks Bro! ^^
Pronob
thanks a lot for this article.i was searching for this.
Amit
Dear sir,
I use your guide with w3 total cache but facing the issue of rendering CSS file. This is link of my blog How its work
Can I use Cloudfare with subdomain CDN ? Is it speed up loading time?
Rahul Rampal
Hi, I have a problem with My yoast sitemaps not rendering. A blank screen appears when I click it. My question is should I include or exclude Sitemap.xsl file in custom file settings in CDN?
Kindly advice.
Dinuka
What is ‘server response time’? And how to reduce it?
Mody Star
Hello , I’m using w3 Total Cache on multisite wordpress … I want to exclude certain site from being excluded
mysite.com/ms/
mysite.com/ms/2/
mysite.com/ms/3/
mysite.com/ms/4/
mysite.com/ms/5/
mysite.com/ms/6/
I want to exclude the whole mysite.com/ms/4/ site from being cached
and what about exclude caching of certain plugin on mysite.com/ms/5/
Help me Please
Utkarsh
I did the settings of W3 total cache plugin and the favicon of my website stopped appearing. Can you please check it
Jon
I downloaded plugin and now its loading slower.
Each time I test in pingdom the % faster than other sites decreases.
Its only a 1 page site at this time.
Ian Smith
I recently set up W3 Total Cache with the Rackspace Cloud Files CDN. It all works, but I had expected the media files in the wp-content/uploads folder to only be posted in the CDN rather than on the server. Instead, media uploads now go to both the CDN AND the wp-content/uploads folder. Is this what is supposed to happen? It seemed unnecessarily redundant to me.
WPBeginner Support
Yes, but the images on your server are stored so that you can end using CDN service anytime you want, or move to another service, or to create backup using WordPress backup plugins. However, your visitors will be served images from the closest CDN server instead of your site.
Administrador
Himanshu Grewal
MAXCDN is free ir not??
WPBeginner Support
No it is a paid service.
Administrador
Ian
Hi,
Are you still using maxcdn on this site? I’m trying to decide between maxcdn and keycdn. I noticed this post was from a few years ago and wondered if your thoughts about maxcdn are still the same?
Thanks
WPBeginner Support
Yes, we still use and recommend MaxCDN.
Administrador
Bart Percy
Superb site you have here but I was wondering if you knew of any forums that cover the same topics discussed in this article? I’d really like to be a part of group where I can get feedback from other knowledgeable individuals that share the same interest. If you have any suggestions, please let me know. Bless you!
ROSANNA
Hi ! I installed yesterday Super Cache because it seemed easier to configure than W3 Total Cache but this morning my site was very very very slow… So I decided to follow your tutorial step by step and change plugins.
So, the first step was to deactivate the first plugin, so I clicked deactivate Super Cache and my whole site crashed !!! I get this message : 503 SERVICE UNAVAILABLE no server is available to handle this request.
I don’t know what to do. Can you help ?
Anant
Minify via disk is currently disabled
I tried to check the box and when I save after the refresh, it’s disable. enabling it 100 times over still results in an unchecked box, and the message “Minify via disk is currently disabled. Anyone know how to fix that ?
Thank you
Reply
TJ
Thank your this tutorial. I have used it for a couple of my sites.
One thing, which might be a “duh” situation… But, I had my site in “Maintenance Mode” using SeedProd’s Coming Soon Pro. I did not see the CDN in front of the image urls until I turned off maintenance mode. Then, when I turned it back on again, they were gone again.
Just in case someone needs this information
Rahul
hi there, thanks for making this post for wp beginners. i’m also using wp total cache plugin for . could you help me or check my website what is problem in this becasie i’m not getting hits pls help me a humble request to u
thanks
Jewel
Hello,
I appreciate so much, your posts. They have helped me learn a bit about setting up my website. However, this particular post led me to check a bunch of boxes under”Performance » Browser Cache” that took me from faster than 91% down to faster than 71% on speed. I had checked them just as you have in your picture above. I unchecked all your suggested boxes and got back to 84%. (on Pingdom) This was the only change I made. I don’t understand why it made things slower, or why I couldn’t get back to my original speed. If you could explain this I would appreciate it. Thanks.
WPBeginner Support
A lot of reasons can show you conflicting results when you are expecting something different. For example, you may have forgotten to save plugin settings, your server is particularly under heavy traffic at that time. Make sure you enable gzip compression as we have shown above, then test.
Administrador
sojib
I am not using this cace plugin anymore. Using now wpfc two of my site. simple and faster then other plugins.
Tea
Thanks for the tutorial…really helpful
However my website is slower then before.
I also have these performance issue “Remove query strings from static resources”.
I haven’t enabled database caching and Minify as per your insutrctions as yet…also don’t have CDN service.
before my website was faster.
Any thoughts?
Thanks
Tea
WPBeginner Support
How are you checking your website speed and performance? We recommend testing with pingdom using different locations. If it is still slow, then try resetting the plugin and follow the setup instructions again.
Administrador
Tea
yes using pingdom to test and speed is 2.55s…I think we can do better
All my performance scores are 100 or 95 the lowest, but the “Remove query strings from static resources” is at 12.
Any suggestions?
Many thanks
Tea
Lifa
This has to be one of the best if not the best Wordpress learning sites ever! Detailed and very easy to understand modules. Thank you for all your hard researched work.
Penelope
THANK YOU FOR MAKING THIS! I’m EXTREMELY cautions on the plugins I install from horror stories. I’ve also heard horror stories about this very plug in. Therefore, I research as much as I can: tutorials, forums, reviews, troubleshooting etc. I am going to follow your tutorial exactly. My server says my site is too large, 500kb, and needs to be gzipped. [sigh] Another plugin to search.
Helpful note: You may have a downloadable instructions on your site somewhere & I am not see it. But It would be helpful if I could download to print OR this was print friendly. you have have link but I am not seeing it.
–Penny
Keami
When I check the box for enable for page cache and click save all setting it doesn’t stay checked. Help please?
reza
Please Inform That if Enable Object Cache is checked may cause very slow or accessible admin panel after some times as happened to me and i have to disable object cache and after that i have no problem with this Great plugin
TnX for your tutorial too
deepa tiwari
Thanks for sharing . I tried to install W3 total cache showing Error not Available for you. How to fix it. Please help me
Manu
i always come back for W3 Super Cache settings after messing-up with the plugin and i never back or restore its settings because i know where to look for it.
Thanks Wpbeginner for this awesome tutorial.
tracey sharp
Many thanks for this really detailed step by step guide. I’ve installed google adsense along with a couple of other plug ins and my load time seems to have almost ground to a halt. I’ve installed Total Cache which has helped a little but I’m not sure what to do next. I’ll keep looking!
Hasnain Abid Khanzada
I have one question that as we know that when we open any new website then browser cache it so then why we need any plugin for improving cache performance?
Muhammad Imran
Hello WPB team,
I have connect MAxCDN by following all the guidlines as suggested in the article. But after some days my 99% images de-indexed in Google. Please is there any tutorial to FIX this? Will be very thankful to you for the help.
Thanks
Tristian
Hi,
I do have one question, when static pages are created for example you have 200 pages and just installed and set up W3 cache. So now when static pages will be created for all those 200 sites.
Do you have to load it manually every site by site in your browser ? I understand that this action takes some time so when exactly those sites are created ( static copies on a disk) ?