Camen Design Forum

PHP and filesystem efficiency?

sull

"Is it wise to use flock() or LOCK_EX in the file_put_contents call?"

is a good decision to use it. i also like to use designated folders for users and other objects whenever feasible so that their are no occurrences of two+ users ever writing to the same files. you could also do this for things like comment threads on an object and recursively construct the thread along with periodic/random cache file creation with logic to check time modified (file system data or file metadata) to determine which data to serve (and post-processes for cache updating) etc etc.

Append

(Leave this as-is, it’s a trap!)

Only the original author or a moderator can append to this post.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn