Welcome Guest, Not a member yet? Register   Sign In
Memcache
#1

[eluser]Warren Noronha[/eluser]
Is there a way to have all the sql results cached in memcache instead of a file based cache?
#2

[eluser]i_like_ponies[/eluser]
Unfortunately CI_DB_Cache doesn't have an override. So you'd have to replace that class in your CI directory if you wanted to switch to memcached from file based caching.

From experience I might suggest something like joining the query and args into a unified string (perhaps with db name and anything else unique) and then doing an MD5 for the key name. We do automatic caching into memcached via regex and MD5 in order to choose what to cache and to do it automatically. We also use a namespace ("query-" prefix) so our caches can't collide with anything else. Another reason for the MD5 is there is a character limit for the key length in memcached.




Theme © iAndrew 2016 - Forum software by © MyBB