Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Slim Initial Release
.htaccess Initial Release
README.markdown
functions.php
index.php
progress.js
worker.php Initial Release

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.