Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Initial Release

latest commit 9541e8a5cb
Dave Marshall authored April 04, 2011
Octocat-spinner-32 Slim Initial Release April 04, 2011
Octocat-spinner-32 .htaccess Initial Release April 04, 2011
Octocat-spinner-32 README.markdown Initial Release April 04, 2011
Octocat-spinner-32 functions.php Initial Release April 04, 2011
Octocat-spinner-32 index.php Initial Release April 04, 2011
Octocat-spinner-32 progress.js Initial Release April 04, 2011
Octocat-spinner-32 worker.php Initial Release April 04, 2011
README.markdown

Asynchronous cache priming with progress bars via Gearman and Memcached

This is a simple example application of how I'm using Gearman and Memcached to provide the user feedback by using asynchronous workers to prime caches if they are not valid

See my blog post for more details at http://www.davedevelopment.co.uk/2011/04/04/asynchronous-cache-priming-with-progress-bars-via-gearman-memcache-and-dojo

Usage

Install Gearman and Memcached, including PECL modules

> sudo su
> apt-get install gearman libgearman-dev memcached
> pecl install memcache 
> pecl install gearman-beta
> echo "extension=memcache.so" > /etc/php5/conf.d/memcache.ini
> echo "extension=gearman.so" > /etc/php5/conf.d/gearman.ini
> /etc/init.d/apache2 restart

Install the application somewhere in the web root

> cd /var/www/
> git clone https://github.com/davedevelopment/async-demo.git

Set the worker going

> cd /var/www/async-demo
> php worker.php

Hit the url

> firefox http://localhost/async-demo/

Slim PHP Microframework

The PHP framework used in this example is availabe at http://github.com/codeguy/Slim

Slim is released under the MIT public license.

http://www.slimframework.com/license

Something went wrong with that request. Please try again.