其他
What's this about?
This is your swiss knife if you plan to implement caching on your php-powered site. It allows you to add tags for a convenient batch-updating of the portions of cache instead of doing it manually with every variable. No need to remember variable names. No need to even assign them.
Currently only memcache is supported. But it is as easy as "extends" to add support for your favorite caching system or even the one you wrote.
Usage
Just run example.php a couple of times<?php
errorreporting(EALL); require_once("CacheTag.class.php");
function f1() { sleep(1); return 1; }
function f2() { sleep(1); return 2; }
CacheTag::SetBackend(CacheTag::BACKEND_MEMCACHE);
//Adding var CacheTag::SetFunction('f1'); CacheTag::SetTags(CacheTag::TAG_PRODUCT); CacheTag::SetParam(CacheTag::PARAM_ID, 2); CacheTag::SetTimeout(0.1); CacheTag::Fetch();
//Adding another var (not
php
缓存
系统
标签
支持
添加
暂无评论