Welcome Guest, Not a member yet? Register   Sign In
Does this Cache library exist?
#1

[eluser]kilishan[/eluser]
I've been thinking a lot about how I want to handle caching in my apps and have come to the conclusion that I'd love to just have the caching be full-page, like the stock CodeIgniter's, but extended so that pages can be easily deleted. I've looked around a bit but have not found something like this.

Has anyone tackled this already, or is there a valid reason why I shouldn't do it this way?

Thanks
#2

[eluser]Jelmer[/eluser]
There's my MP_Cache library (it's in my sig) and Phil Sturgeon forked it a while back in a slightly different version.
Both of which can be easily adapted to be full page, but give you more control.

Or you could simply write some code that can delete specific CI caches, just be carefull when implementing that because pages should really only be reachable through one URI and not be flexible in accepting arguements (otherwise you can't know the hashes for certain).
#3

[eluser]Phil Sturgeon[/eluser]
Seeing as the page is cached by the URL of a page, you could easily work out which cache file to delete if you know the URL of what you are deleting.

Code:
$uri =    $CI->config->item('base_url').
                $CI->config->item('index_page').
                'pages/this-page';
        
        $cache_path .= md5($uri);
#4

[eluser]kilishan[/eluser]
@Jeimer: I've used both of the libraries and they're both very good. For this latest project I was wanting to try something different.

@Phil: That's what I thought I remembered, but figured that I'd see if anyone had made anything like that yet. Seems simple enough to extend, though, so I'll get to work on that shortly.




Theme © iAndrew 2016 - Forum software by © MyBB