From 692ef4307a593edb3d55bbc66bb1a6832466cfe3 Mon Sep 17 00:00:00 2001
From: Benjamin Adams <Armastevs@gmail.com>
Date: Mon, 15 Jul 2013 13:18:30 -0500
Subject: [PATCH] Clearing the cache of the frontpage when updating a post

---
 README.md                | 8 ++++++--
 index.php                | 8 ++++++++
 wp-redis-cache/cache.php | 5 +++++
 3 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 index.php

diff --git a/README.md b/README.md
index 57588a6..fad018c 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 ## Wp Redis Cache
-======
+------
 Cache Wordpress using Redis, the fastest way to date to cache Wordpress.
 
 ### Requirements
@@ -23,8 +23,11 @@ Move the `index-wp-redis.php` to the root/base Wordpress directory
 Change the `index.php` to:
 ```php
 <?php
-require('index-wp-redis.php')
+require('index-wp-redis.php');
+?>
 ```
+In `index-wp-redis.php` change `$ip_of_your_website` to the IP of your server
+
 *Note: Sometimes when you upgrade Wordpress it will replace over your `index.php` file and you will have to redo this step.  This is the reason we don't just replace the contents of `index-wp-redis.php` with `index.php`.
 
 We do this because Wordpress is no longer in charge of displaying our posts.  Redis will now server the post if it is in the cache.  If the post is not in the Redis cache it will then call Wordpress to serve the page and then cache it for the next pageload
@@ -35,6 +38,7 @@ We do this because Wordpress is no longer in charge of displaying our posts.  Re
 I welcome you to compare the page load times of this caching system with other popular Caching plugins such as [Wp Super Cache](http://wordpress.org/plugins/wp-super-cache/) and [W3 Total Cache](http://wordpress.org/plugins/w3-total-cache/)
 
 With a fresh Wordpress install:
+
 Wp Super Cache
 ```
 Page generated in 0.318 seconds.
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..1081950
--- /dev/null
+++ b/index.php
@@ -0,0 +1,8 @@
+<?php
+
+require('index-wp-redis.php');
+
+//define('WP_USE_THEMES', true);
+//require('./wp-blog-header.php');
+
+?>
\ No newline at end of file
diff --git a/wp-redis-cache/cache.php b/wp-redis-cache/cache.php
index 54ad340..9f8587d 100644
--- a/wp-redis-cache/cache.php
+++ b/wp-redis-cache/cache.php
@@ -15,5 +15,10 @@ $redis = new Predis_Client();
 
 $redis_key = md5($permalink);
 $redis->del($redis_key);
+
+//refresh the front page
+$frontPage = get_home_url() . "/";
+$redis_key = md5($frontPage);
+$redis->del($redis_key);
 }
 }
\ No newline at end of file
-- 
GitLab