Giter Club home page Giter Club logo

smart-cache's Introduction

SmartCache

Smart cache library for Codeigniter framework.

This Codeigniter library supports partial caching and it is very simple library to learn and use. I have created this library originally for using in the codeigniter websites generated using https://thephpcode.com website generation wizard. After seeing lot of questions and discussions I thought it is worth to share this library to the community.

Usage

Use the below code to cache the output
$this->load->library('smartcache');
$this->smartcache->save_output('filename_here');

Use the below code to get the cached output after loading the view using $this->load->view('viewFileName');

$this->load->library('smartcache');
if($this->smartcache->get_to_output('filename_here'))
{
    // Cached data is now in Codeigniter output buffer
    // If nothing else to do simply return here
}
else
{
    // no cache data available
    // so you can load the data from view here
}

For full documentation please refer https://thephpcode.com/help/library_smartcache.html

smart-cache's People

Contributors

msnisha avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

yenkuan

smart-cache's Issues

Help using this library

Hello,

How (or even better - WHERE) do I use this library? I have tried to place your example code in my controller:

$data = $this->smartcache->get_data($cache_filename);
if($data)
{
    $this->output->set_output($data);
}
else
{
    //do your processing
    $data = $this->output->get_output();
    $this->smartcache->save_data($cache_filename, 10);
}

However, my cache files are empty because by the time I get/save output ($data = $this->output->get_output();) - the view is still not loaded. Any advices?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.