Web Page Caching |
Hello Everyone.
I'm trying to cache the html output, I tried this as mentioned in CI document by keeping the code '$this->output->cache(100);' on controller. This do created the cache file under application/cache directory with random file name as expected but now I need this file to be deleted whenever I alter the database i.e (insert, update, delete). How can I achieve this. I manually tried to delete the file by writing this code ($this->output->delete_cache()), as mentioned in document this should delete the cache file for the currently requested url but this didn't work. I created the cache file on default controller.
I think you need to specify which cache to delete like below:
PHP Code: // Deletes cache for /foo/bar To enable the profiler place the following line anywhere within your Controller methods: PHP Code: $this->output->enable_profiler(TRUE); This should tell you the name of your cache but not sure, untested. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(08-14-2017, 04:15 AM)InsiteFX Wrote: I think you need to specify which cache to delete like below: |
Welcome Guest, Not a member yet? Register Sign In |