Foursquare: Here’s A Solution to Your PleaseRobMe Problem
March 11, 2010 – 12:50 PM | 0 Comments

By now you have probably heard of PleaseRobMe a service which aggregates all of the foursquare check-in’s into one place using the tweets sent out through the application.  There has been a lot of uproar …

Read the full story »
Geek

Read about the latest geek trends, news, and gadgets right here!

Malware Report

Learn about the latest threats online, how to remove them, and even how to prevent them.

Software

Find all the latest and greatest software out there for Windows, Mac, and Linux.

Twitter

Keep up with the latest from one of the web’s hottest sites (twitter.com).

Video

Never miss another of my videos again – view the latest videos from live.besttechie.net!

RSS FeedEmail SubscriptionsTwitterYouTubeFacebook
buzz_button

Home » WordPress
    Share/Bookmark

Stop WP-Cache From Caching Your Index

Submitted by Jeff Weisbein on May 19, 2008 – 8:49 PM0 Comments
Stop WP-Cache From Caching Your Index

I recently ran across the issue after re-enabling WP-Cache on my blog of having my index.php being cached. This was an issue for me because I have my Twitter feed update on my front page and I wanted that to be current when I posted a new tweet. The solution to my problem was relatively simple, yet a bit of a hack job so if anyone knows of a better way to do this feel free to leave a comment.

The first thing you need to do is open your FTP client, connect to your server and navigate to wp-content -> plugins -> wp-cache now you want to download the file wp-cache-phase2.php locally, open your favorite editor and find this piece of code:

function wp_cache_is_rejected($uri) {
global $cache_rejected_uri;

if (strstr($uri, '/wp-admin/'))
return true; //we don't allow cacheing wp-admin for security
foreach ($cache_rejected_uri as $expr) {
if (strlen($expr) > 0 && strstr($uri, $expr))
return true;
}
return false;
}

Replace that with:

function wp_cache_is_rejected($uri) {
global $cache_rejected_uri;

if(strstr($uri,'/wp-admin/') || $uri==='/' || strstr($uri,'/index.php'))
return true; //we don't allow cacheing wp-admin for security
foreach ($cache_rejected_uri as $expr) {
if (strlen($expr) > 0 && strstr($uri, $expr))
return true;
}
return false;
}

Obviously this can be applied to any page on your blog.

This worked for me I cannot make any guarantee’s it will work for you, but it should if done properly.

Related Products:

PHP and MySQL Web Development (4th Edition)
Learning PHP, MySQL, and JavaScript: A Step-By-Step Guide to Creating Dynamic Websites (Animal Guide)
Head First PHP & MySQL
PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide
Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems

You might also like:

The iPhone 3G S Will Indeed Be Speedy

WordPress Plugins Compilation

How To: Improve WordPress Performance

Western Digital 2 TB Caviar Green SATA Intellipower 64 MB Cache Bulk Hard Drive for $214 + Free Shipping!

Tags: ,