Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Deleting Caches in Codeigniter

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 29.4k
    Comment on it

    Some time developers fetch the cache problem when they are developing the app with the codeigniter framework. Below I am giving some methods that how you can clear the cache of codeigniter.

    In codeigniter, the cache is save in the folder with the path 'application/cache'.

    If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: Removing the tag will not delete the cache immediately. It will expire after some time normally. If you need to remove it, you will need to manually delete it from your cache folder which is 'application/cache' and also there is 2 other methods with which you can delete the cache. Which are-

    1. Clearing all cache : You can clear the entire cache directory by calling $this->output->clear_all_cache();

    Note: This will not remove the .htaccess and index.html files in the applications/cache folder.

    $this->output->clear_all_cache(); // Clears all cache from the cache directory
    

    This method returns NULL.

    2. Clearing a cached path : You can clear any specified path of its cache by calling following method.

    $this->output->clear_path_cache($uri); //Clears the cache for the specified path
    

    This method will return boolean TRUE if successful, FALSE if not.

 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: