W3tc plugin feed problem

When your WordPress site has a great number of requests it could happen that your server can’t handle all the…

October 22, 2012

When your WordPress site has a great number of requests it could happen that your server can’t handle all the requests and can become very slow, rising errors, getting timeouts and -at last- can stop working. This happens because your WordPress site make a lot of work to render a page.

To avoid those problems, usually, developers use a cache. This means that when a visitor requests a page, the server create the page and stores it in a ready-to-serve version, an html static copy og page that doesn’t need database anymore. When there is a cache working, new requests are sent to the php WordPress site and processed as usual, instead if a page has been already processed, the static version stored in the cache is served:

This lets your WordPress site go faster.

Wt3c plugin is a tool for WordPress that lets you control how your WordPress site handles cache at many levels: you can control page cache, db cache, javascript and css cache, you can handle an external cdn link to handle files better and much more. It’s one of the best caching plugin service, but it has a problem: it caches also rss feed, and you can’t tell him to not cache feed unless you tell him to also don’t cache categories and tags pages.

In the next version (now it’s this control will be fixed, they said, but at the moment this issue prevents correct working for services like Feedburner, or the refresh in Google reader or any other feed reader you use, since w3tc keeps serving the bad version of your feed until the cache becomes old or someone manually clears the cache.

You can fix it by editing the .htaccess and telling w3tc to handle your feed as an admin page, without caching it, this way, from this:

RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|
\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php) [NC,OR]


RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|
\/feed\/|\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php) [NC,OR]

(this is on two lines but you have to piut it on a single line).

This seems to work for me. :-)


I'm a software engineer, an everyday web developer and a maker. I usually build sites with PHP, within or without WordPress. I build Internet of Things with Arduino and ESP8266. I'm the founder of Rockit.it and Dailybest.it and I'm actually the Chief Technical Officer of Better Days web agency.

Comments on “W3tc plugin feed problem”

2 thoughts

  1. Ridhim says:

    I’m having a PhotoBlog if I use this plugin will it instantly update the cache ?
    Or it will take some refresh to do so ?

  2. Giulio Pons says:

    I don’t know PhotBlog, if you install w3tc on a wordpress it will start caching contents meanwhile visitors load pages.

Comments are closed


Optimize WordPress, a long list of tips

In the above image you can see your WordPress before reading this post, and after the optimizations you will make…

September 15, 2015

How to add rel=”nofollow” to links with preg_replace()

Adding rel="nofollow" to external link is a good SEO practice.

September 22, 2015

Social buttons: the fastest way for WordPress, without plugins

NOTE: the code in this post is written for WordPress but you can easily translate it in any language. You’re here…

September 15, 2015

Limit the number of categories for posts in WordPress

CHOOSE ONLY ONE CATEGORY WORDPRESS If you need to limit the number of categories used by the authors of your…

September 14, 2015

Remove archive pages in WordPress, how to

I think that in most blogs (that is not all) archive pages are redundant content and there’s no need to…

September 8, 2015

WordPress anyone can register, but no email confirmation

Many times it has happened to me that my WordPress installation properly send emails using wp_mail directly, specifing also the…

August 25, 2015