Welcome Guest, Not a member yet? Register   Sign In
Partial Cache Library
#11

[eluser]peterw88[/eluser]
Thank you for this caching function, it is exactly what I was looking for. I'm testing it now but I have a question.

Your function generates the path of the file like this:

Code:
$key = $CI->uri->uri_string() . '/' . $id;
$hash = md5($key);
$path = $CI->config->item('cache_path') . 'partial_' . $hash;

But that does not correspond with the name of the created file. For example: the ID "vakanties/criteriavakanties" on the URL http://vakantiesite.local/vakanties.htm gives this path:
Code:
partial_375f1afcb3c61f3418bda16ffb389666

but the name of the generated file is:

Code:
partial_4fa91ae063a592416813e67bb7351cf0

Now I can't check if a cached file exists. Do you have the solution for me?
#12

[eluser]peterw88[/eluser]
I've just found out that the cache_start() function generates the name from a slightly different key. In cache_exists is uses the key (in my example):

Code:
vakanties/criteriavakanties

and in cache_start():

Code:
/vakanties/index/criteriavakanties

In cache_start() is uses /CONTROLLER/METHOD/ID
#13

[eluser]Daeli[/eluser]
Oh, right. I fixed it later in my version though. I'll update the fixed version of this.
#14

[eluser]Daeli[/eluser]
Alright, it should be fixed now. Main post updated.




Theme © iAndrew 2016 - Forum software by © MyBB