Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use caching in codeigniter

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 114
    Comment on it

    Web page caching

    Lets we use the caching in codeigniter to achieve the maximum performance.
    While CodeIgniter is quite fast, the amount of dynamic data you display in your hypertext pages will correlate directly to the server resources, memory, and processing cycles utilized, which affect your web page load speeds. By caching your web pages, since they are saved in their fully rendered state, you can achieve better performance that nears that of static web pages .

    How does caching work ?

    We can enabled Caching on the per-page basis, and also you can set the length of time that a page should remain cached before being refreshed web pages. When a page is loaded for the first time, then cache file will be written to your application/cache folder. On that time subsequent page loads the cache file will be retrieved and sent to the requesting user's browser. If it has expired the time, it will be deleted information and refreshed the web pages before being sent to the browser.
    How to enabling caching ?

    To enable caching, put the following tag in any of your controller functions and use this line of code below.

    $this->output->cache(n);
    

    Where n is the number of minutes you want to remain web page cached between refreshes.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: