Thanks to visit codestin.com
Credit goes to github.com

Skip to content

foo123/Unicache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNICACHE

An agnostic caching framework for PHP, JavaScript, Python

Unicache

 ____ ___      .__                     .__
|    |   \____ |__| ____ _____    ____ |  |__   ____
|    |   /    \|  |/ ___\\__  \ _/ ___\|  |  \_/ __ \
|    |  /   |  \  \  \___ / __ \\  \___|   Y  \  ___/
|______/|___|  /__|\___  >____  /\___  >___|  /\___  >
             \/        \/     \/     \/     \/     \/

Logo Ascii Art by Text-to-Ascii Art Generator

version: 1.3.0

Contents

How to Use

PHP

This is a caching framework for applications that is agnostic.

This means that one can use it easily in her web applications that use any given framework or not use any framework at all.

The framework is configured by a config file which easily gets together all parameters, like type of caching, time to live, post-cache user defined filtering and per-page user defined cache disable.

A demo is included with the package. One simply adds an include directive and bang you have the most advanced caching.

NodeJS

Supports both node-style callback-based methods (nodebacks) plus promise-based methods (if Promises are supported). Each method (i.e get, put, remove, clear, gc) has an associated method that returns a promise (i.e getPromise, putPromise, removePromise, clearPromise, gcPromise). Also some cache types (i.e memory-based and file-based) support synchronous operations as well (if no callback is provided synchronous processing takes place).

Browser

Supports both callback-based methods plus promise-based methods (if Promises are supported). Each method (i.e get, put, remove, clear, gc) has an associated method that returns a promise (i.e getPromise, putPromise, removePromise, clearPromise, gcPromise). Also some cache types (i.e memory-based, cookie-based, webStorage-based) support synchronous operations as well (if no callback is provided synchronous processing takes place).

Types of Caching Supported

server-side

  • In-Memory caching (default) PHP + NodeJS
  • File-based caching PHP + NodeJS
  • APC PHP
  • APCU PHP (requires apcu extension)
  • XCache PHP (requires xcache extension)
  • Memcached PHP (requires Memcache or Memcached extension) + NodeJS (requires node-memcached module)
  • Redis PHP + NodeJS (requires node-redis module)
  • it is easy to extend to other methods as well.

client-side

  • In-Memory caching (default)
  • Cookie-based caching
  • LocalStorage
  • SessionStorage
  • IndexedDb-based caching
  • WebSql-based caching (supported only on some browers, eg Chrome)
  • it is easy to extend to other methods as well.

TODO

  • add python implementations
  • add client-side/browser support for webSql caching [DONE]
  • add support for Redis [DONE]
  • add support for xCache [DONE]
  • nodejs and browser cache manipulation methods use standard callbacks (i.e as last argument w/ signature: function(err, result)) [DONE] and also promises (via same method names with "Promise" suffix) [DONE]

ChangeLog

see also:

  • ModelView a simple, fast, powerful and flexible MVVM framework for JavaScript
  • tico a tiny, super-simple MVC framework for PHP
  • LoginManager a simple, barebones agnostic login manager for PHP, JavaScript, Python
  • SimpleCaptcha a simple, image-based, mathematical captcha with increasing levels of difficulty for PHP, JavaScript, Python
  • Dromeo a flexible, and powerful agnostic router for PHP, JavaScript, Python
  • PublishSubscribe a simple and flexible publish-subscribe pattern implementation for PHP, JavaScript, Python
  • Localizer a simple and versatile localization class (l10n) for PHP, JavaScript, Python
  • Importer simple class & dependency manager and loader for PHP, JavaScript, Python
  • EazyHttp, easy, simple and fast HTTP requests for PHP, JavaScript, Python
  • Contemplate a fast and versatile isomorphic template engine for PHP, JavaScript, Python
  • HtmlWidget html widgets, made as simple as possible, both client and server, both desktop and mobile, can be used as (template) plugins and/or standalone for PHP, JavaScript, Python (can be used as plugins for Contemplate)
  • Paginator simple and flexible pagination controls generator for PHP, JavaScript, Python
  • Formal a simple and versatile (Form) Data validation framework based on Rules for PHP, JavaScript, Python
  • Dialect a cross-vendor & cross-platform SQL Query Builder, based on GrammarTemplate, for PHP, JavaScript, Python
  • DialectORM an Object-Relational-Mapper (ORM) and Object-Document-Mapper (ODM), based on Dialect, for PHP, JavaScript, Python
  • Unicache a simple and flexible agnostic caching framework, supporting various platforms, for PHP, JavaScript, Python
  • Xpresion a simple and flexible eXpression parser engine (with custom functions and variables support), based on GrammarTemplate, for PHP, JavaScript, Python
  • Regex Analyzer/Composer Regular Expression Analyzer and Composer for PHP, JavaScript, Python