WorldWideScripts.net Delivering the best Add-Ons in more than 37 languages.

中文(简体), English, हिन्दी/हिंदी, Español/Castellano, العربية, Русский язык, Français, 中文 (台灣), বাংলা, Bahasa Indonesia, اردو, Português, Deutsch, Bahasa Melayu (بهاس ملايو‎), 日本語 (にほんご), فارسی, Italiano, తెలుగు, Türkçe, ગુજરાતી, Język polski/polszczyzna, Tiếng Việt, ಕನ್ನಡ, Українська мова, ไทย
PHP Scripts / Database Abstractions

SuperCache

— Add-On to WorldWideScripts.net

Subscribe to our feed to stay up to date!

New! Follow us as you want it!


SuperCache - CodeCanyon Item for Sale

Ads

Ad: Bluehost hosting

Changelog

  • V 1.0
    • Release version
  • V 1.1
    • Splitted file cache in 2 seperate caching types. Session caching used a lot of resources.
    • Fixed compression bug with memcache
    • Update guestbook example (small update bug).
  • V 2.0
    • Adding PSR2 format
    • Added Xcache
    • Added prefix
    • Added options

What is SuperCache

SuperCache is an easy caching API for every project you might need. These classes reduces server load by using cache. There are three types of caching APC, Xcache, Memcache and FILE/SESSION cache. APC and Memcache uses the PHP Modules so make sure you install them first before using it. File cache doesn’t need anything special.

Features

  • PHP 5.3+: We used the latest php techniques including namespaces.
  • OO written: We used OO techniques to make it easy adaptable and making it easy to add new caching methods.
  • Compression support: GZIP compression on the data is possible.

Four Cache Types

APC
APC is a single server caching mechanism which allow you to cache data. APC also does opcode caching so your php doesn’t have to compile every time. ( http://www.php.net/manual/en/book.apc.php)

XCache
XCacheis a single server caching mechanism which allow you to cache data. XCache also does opcode caching so your php doesn’t have to compile every time. ( http://xcache.lighttpd.net/)

Memcache
Memcache is a multi server caching mechanism which allow you to cache data. Memcache is a daemon that runs on your server which makes it possible to connect to it from everywhere you like. Also memcache is not bound to PHP. ( http://www.php.net/manual/en/book.memcache.php)

File
File caching keeps the cache inside the session and rewrites it to the filesystem so we can pick it up again when a user reconnects to the website

How to use

require_once("SuperCache/CacheFactory.php"); $cache = \SuperCache\CacheFactory::create("APC"); // use APC, Memcache, File (case-sensitive) $cache->insert($key, $data, $lifetime, $compress); $cache->update($key, $data, $lifetime, $compress); $cache->set($key, $data, $lifetime, $compress); $cache->remove($key); $cache->fetch($key); $cache->exists($key); $cache->clearCache(); $cache = null; $cache = \SuperCache\Cache::getInstance(); // return Apc cache or the one that was made with factory

Download
Other components in this categoryAll components of this author
CommentsFrequently asked questions and answers

Properties

Created:
16 August 12

Last Update:
27 November 13

Files Included:
PHP

Software Version:
PHP 5.3

Keywords

eCommerce, eCommerce, All Items, APC, cache, memcache, PHP API, xcache