Hi,
We have a lot of "s3fs_file" select queries.
Because we are using redis (or memcache), using standard drupal caching tables for this info, can be a big optimalisation.
Is this a good idea? I am going to digg into the code, and can use any help.
We can do this caching in _read_cache() in S3fsStreamWrapper.inc
Comments
Comment #1
Jurgen8en commentedComment #2
Jurgen8en commentedLike this?
Where to clear the cache?
cache_clear_all('s3fs:uri:'.$uri, 'cache');Comment #3
coredumperror commentedI find it fairly amusing that what you're doing here is caching a cache, since
s3fs_fileis a local cache of the file metadata in the S3 bucket. But I agree that this is probably a good idea for folks using faster caching a mechanism than the DB.This feature will require a little more code than than what you've shown here, though, since the metadata cache refresh mechanism will need to also clear the drupal cache. I'll go ahead and implement that, and push it up to git in a bit.
Comment #5
coredumperror commentedAlright, I pushed a change that I'm hoping will be the correct implementation for this caching. Please download the latest dev release to try it out, and let me know the results, good or bad.
Comment #6
coredumperror commentedComment #7
Jurgen8en commentedI am going to test later.
Comment #9
coredumperror commentedSince this has been in the code since June, and no one's complained about it, I'm assuming it at least didn't cause any problems. So I'm going to close this issue as "fixed". If you feel that this issue should be re-opened, feel free to do so.
Comment #10
5n00py commentedI found that commit #08e6bc0630d3ce7b6dac65712b3c3dccaca78a29 removing this caching mechanism.
Can someone tell about performance changes with/without this patch?