You can use CodeIgniter caching to cache (or temporarily store) practically anything. As an example of caching with CodeIgniter, we're going to cache an RSS feed. We could, of course, cache anything we wanted; however, caching an RSS feed is a good place to start. Working with RSS is quite simple and the recipe can easily be converted to cache feeds from other sources, such as a call to Twitter, for example.
We're going to create the /path/to/codeigniter/application/controllers/rss_cache.php
file.
Create the preceding file and add the following code to it:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Rss_cache extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper('url'); $this->load->helper('xml'); $this->load->driver('cache', array('adapter' => 'apc')); } public function index() { $raw_feed = '<?xml version = "1.0" encoding...