Welcome Guest, Not a member yet? Register   Sign In
Using the Caching Driver with files or MySQL
#1

[eluser]Unknown[/eluser]
Greetings all,

I need a file-based or MySQL-based server-side cache utility, and I'm wondering about the Caching Driver (http://ellislab.com/codeigniter/user-gui....html#file).

The documentation on that page is a bit brief, and I'm wondering if anyone can point me to some deeper examples of using the caching driver? Specifically with a file-based or MySQL-based data store.

I need the cache to be able to handle locking for serving of concurrent read/writes, and hopefully be pretty scalable. What I need it for is caching a Twitter feed on the server (or several Twitter feeds). Does the Caching Driver handle concurrency well?

Thanks for any pointers!
-NorthK
#2

[eluser]Aken[/eluser]
The file cache allows you to specify the name of the cached file that is created/served. So as long as you have a way of identifying each unique cached output, you can serve them appropriately.

I can't say much about the scalability of it, but it should be able to handle what you'd like.
#3

[eluser]Unknown[/eluser]
Aken,

Do you know how the Caching Driver handles concurrency? I.e. does it use flock() and what does it do if it can't get a lock?

In attempting to write my own cache class I see there's a lot to think about here Smile For example if you open the cache file with an exclusive lock, how long do you wait to receive the lock and what should you do if you can't get the lock. I've been looking at a lot of PHP cache classes and many don't handle this very well.

Thanks,
-NorthK
#4

[eluser]Aken[/eluser]
I don't know off hand how it handles concurrency. But if your Twitter feeds are unique to various users, you wouldn't need to worry about that I would think.

Dig through the Cache classes and check it out.




Theme © iAndrew 2016 - Forum software by © MyBB