Generic cache in your app - tons of different tools
Generate a file for your web server to serve
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ generate.php?filename=$1 [L,QSA]
Huge associative array persisted across requests
$memcache = new Memcache; $memcache->connect('localhost', 11211) or die ("Can't connect"); $val = $memcache->get('hardtocompute'); if ($val === FALSE) { $val = computeThisHardThing(); $memcache->set($val); } echo "This one is hard to get, but we cache it: $val";
memcached, APC, Redis, Tokyo Cabinet / Tyrant ... even Amazon S3
Key-value interface can be abstracted (Zend_Cache)
<!DOCTYPE HTML> <html manifest="my.cache.manifest"> ...Manifest file (Content-type: text/cache-manifest)
CACHE MANIFEST index.html help.html style/default.css images/logo.png images/backgound.png
localStorage.setItem(key, value); localStorage.getItem(key); localStorage.removeItem(key); localStorage['key'] = value; localStorage.key = value; localStorage.length; localStorage.clear();
These slides use an HTML presentation tool Slidy.
They are valid XHTML document with rich metadata embedded using RDFa.
How to make cache work for you by
Sergey Chernyshev
is licensed under a
Creative Commons Attribution 3.0 United States License.
Permissions beyond the scope of this license
available here.