GithubHelp home page GithubHelp logo

wp-redis-cache's Introduction

Wp Redis Cache

Cache Wordpress using Redis, the fastest way to date to cache Wordpress.

Requirements


  • Wordpress - CMS framework/blogging system
  • Redis - Key Value in memory caching
  • Predis - PHP api for Redis

Installation


Install Redis, must have root access to your machine. On debian it's as simple as:

sudo apt-get install redis-server

On other systems please refer to the Redis website.

You can install the pecl extension (faster)

apt-get install php5-redis

If you don't have the pecl extension installed it will default to use Predis.

Move the folder wp-redis-cache to the plugin directory and activate the plugin. In the admin section you can set how long you will cache the post for. By default it will cache the post for 12 hours. Note: This plugin is optional and is used to refresh the cache after you update a post/page.

Move the index-wp-redis.php to the root/base Wordpress directory.

Move the index.php to the root/base Wordpress directory. Or manually change the index.php to:

<?php
require('index-wp-redis.php');
?>

In index-wp-redis.php change $websiteIp to the IP of your server. If you want to use sockets, change $sockets to true and enter the path of your socket in $redis_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 serve 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.

Benchmark


I welcome you to compare the page load times of this caching system with other popular Caching plugins such as Wp Super Cache and W3 Total Cache.

With a fresh Wordpress install:

Wp Super Cache

Page generated in 0.318 seconds.

W3 Total Cache

Page generated in 0.30484 seconds.

Wp Redis Cache

Page generated in 0.00902 seconds.

wp-redis-cache's People

Contributors

aaronstpierre avatar benjaminadams avatar fab120 avatar jacobschweitzer avatar repat avatar robwiddick avatar ruebenramirez avatar szepeviktor avatar ulrichblock avatar vsilent avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.