Hey guys, I've ran into a bit of an issue using CFileCache. Basically if two simultanous page loads write to the same cache file this can (and has) result in corruption of data in that file.
I was wondering if I was missing anything to do with locking or similar that would already be implemented. Or do I have to come up with my own solution?
Thanks in advance
Page 1 of 1
Multiple Cfilecache Writing To Same File At The Same Time
#2
Posted 25 January 2013 - 06:04 AM
CFileCache writes data with:
and LOCK_EX flag according to PHP documentation stands for "Acquire an exclusive lock on the file while proceeding to the writing."
so... it should not cause problems with simultaneous access...
file_put_contents($cacheFile,$value,LOCK_EX)!
and LOCK_EX flag according to PHP documentation stands for "Acquire an exclusive lock on the file while proceeding to the writing."
so... it should not cause problems with simultaneous access...
red
#3
Posted 25 January 2013 - 06:08 PM
redguy, on 25 January 2013 - 06:04 AM, said:
CFileCache writes data with:
and LOCK_EX flag according to PHP documentation stands for "Acquire an exclusive lock on the file while proceeding to the writing."
so... it should not cause problems with simultaneous access...
file_put_contents($cacheFile,$value,LOCK_EX)!
and LOCK_EX flag according to PHP documentation stands for "Acquire an exclusive lock on the file while proceeding to the writing."
so... it should not cause problems with simultaneous access...
That's very interesting!! I didn't check that far in. In that case I'm indeed mistaking and the issue lays elsewhere (mea culpa).
Maybe the issues lay in the locks of the files used to generate the cache file content.
Thanks a lot!!
Share this topic:
Page 1 of 1

Help













