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 0.9.2.4) 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]

to:


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. :-)

Author

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

Recommended

Fix for WP SUPER CACHE home not refreshing

WP SUPER CACHE is one of the most used WordPress plugin for cache, but probably there is a small bug…

December 1, 2014

WordPress Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0

How I've beat the php mysterious fatal error unknown in Wordpress caused by caching plugin WP Fastest Cache

November 7, 2019

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

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…

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