All Projects → stevenbenner → codeigniter-cache-helper

stevenbenner / codeigniter-cache-helper

Licence: MIT License
📤 A CodeIgniter output cache helper.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to codeigniter-cache-helper

sCache
Kolay PHP Cache sistemi sadece 1 satırda cache sisteminizi kurun.
Stars: ✭ 50 (+163.16%)
Mutual labels:  cache
git-cache-http-server
A caching Git HTTP server
Stars: ✭ 65 (+242.11%)
Mutual labels:  cache
gotcha
[Not Safe For Production] gotcha: inmemory-cache in Go (Golang) with customizable algorithm
Stars: ✭ 13 (-31.58%)
Mutual labels:  cache
codeigniter-role-base-access-control
CodeIgniter Role Base Access Control library is an easy understandable, comprehensive and convenient way to manage users.
Stars: ✭ 59 (+210.53%)
Mutual labels:  codeigniter
cache-trace
A collection of Twitter's anonymized production cache traces.
Stars: ✭ 89 (+368.42%)
Mutual labels:  cache
rememberable
Laravel Traits for fast integration of model caching
Stars: ✭ 28 (+47.37%)
Mutual labels:  cache
node-backend-template
A template for NodeJS backend projects
Stars: ✭ 19 (+0%)
Mutual labels:  cache
personJudge
personJudge System 网站预览---->http://47.106.235.227 (账号111,密码12345) 后端:SpringBoot/JPA/mysql/cache/前后端分离(nginx做静态转发)/swagger 前端:bootstrap+Jquery及其插件:jquery-cookie,toastr,steps,validate,wnumb,nouislider,DataTables,layer,chosen,echarts
Stars: ✭ 35 (+84.21%)
Mutual labels:  cache
justreq
A caching proxy server for testing interface of HTTP or HTTPS. A never offline testing interface server. A mock server
Stars: ✭ 15 (-21.05%)
Mutual labels:  cache
CodeIgniter-phpstorm-plugin
PhpStorm plugin for CodeIgniter development
Stars: ✭ 18 (-5.26%)
Mutual labels:  codeigniter
AppleCache
Apple Content Cache Reverse Engineering
Stars: ✭ 82 (+331.58%)
Mutual labels:  cache
codeigniter-queue-worker
CodeIgniter 3 Daemon Queue Worker (Consumer) Management Controller
Stars: ✭ 67 (+252.63%)
Mutual labels:  codeigniter
deflix-stremio
Deflix addon for Stremio
Stars: ✭ 31 (+63.16%)
Mutual labels:  cache
ci4-album
🔥 CodeIgniter 4 example Album module uses Domain Driven Design Architecture with Tactical Pattern
Stars: ✭ 67 (+252.63%)
Mutual labels:  codeigniter
storage
Go package for abstracting local, in-memory, and remote (Google Cloud Storage/S3) filesystems
Stars: ✭ 49 (+157.89%)
Mutual labels:  cache
magento2-LiteSpeed LiteMage
LiteMage Cache Extension for Magento 2
Stars: ✭ 27 (+42.11%)
Mutual labels:  cache
tendoo-cms
This version of Tendoo CMS is not supported by Nexo Solutions. If you want to use Gastro, you need to have NexoPOS
Stars: ✭ 51 (+168.42%)
Mutual labels:  codeigniter
express-view-cache
Unobtrusive solution to express framework - cache rendered page, without database requests and rendering.
Stars: ✭ 20 (+5.26%)
Mutual labels:  cache
moka
A high performance concurrent caching library for Rust
Stars: ✭ 346 (+1721.05%)
Mutual labels:  cache
WP-Performance
Speed optimization plugin for Wordpress
Stars: ✭ 22 (+15.79%)
Mutual labels:  cache

CodeIgniter Cache Helper

I am a huge fan of output caching and CodeIgniter has a very effective output caching system, however, it is lacking some very important functions for managing the cache files. CodeIgniter Cache Helper fixes that issue by giving you a simple helper that you can add to your CodeIgniter project that will let you manage your output cache files in code.

Requirements

  • CodeIgniter 2.0+ (It can be modified to work in <1.7.2 by changing "APPPATH" to "BASEPATH")

Installation

Manual installation

Add the cache_helper.php file to your "helpers" directory in the application folder.

Spark installation

This helper can be installed and run as a spark. Install the current version with this command:

php tools\spark install -v1.4.2 cache-helper

Usage

Load the helper any time you want to use its functions. You can then call any of the functions directly. Helper functions do not need to be called through CodeIgniter's $this object.

For manual install

$this->load->helper('cache');

For spark install

$this->load->spark('cache-helper/1.4.2');

Function reference

Function Return Description
get_cache_folder() string Returns a string containing the path to the cache directory. (e.g. '/var/www/application/cache')
get_cache_file($uri_string) string Returns a string with the path to the cache file for a specific URI. (e.g. '/var/www/application/cache/d41d8cd98f00b204e9800998ecf8427e') This function does not check for the existence of that cache file, it merely tells you where CodeIgniter would cache that resource.
get_all_cache_files() array Returns an object containing information for every file in the cache directory. Uses the get_dir_file_info() function from the File Helper. The returned object will be in that format.
delete_cache($uri_string) bool Attempts to delete the cached file for the specified resource. Returns TRUE upon success or if that file does not exist, returns FALSE on failure.
delete_all_cache() void Attempts to delete ALL cache files. Does not return anything.
delete_expired_cache() void Attempts to delete all cache files which have expired. Does not return anything.
get_cache_expiration($uri_string) int Attempts to read the expiration time stamp from the cache file for the specified resource. Returns an integer with the time stamp (UNIX time stamp in time() format, e.g. 1307158229) if it could find and parse the file, returns FALSE if there is no cache file for the resource or if there was a problem reading/parsing the file.

Notes

  • The $uri_string argument is the URI string of the resource you are looking for (e.g. 'blog/article/123'). This is designed to be used with CodeIgniter's uri_string() method from the URI Class.

License

(This project is released under the MIT license.)

Copyright (c) 2012 Steven Benner, http://stevenbenner.com/

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].