physaux Posted November 10, 2009 Share Posted November 10, 2009 Hey guys, I am trying to get my cache system up and running. I don't want to query my database evertime a user wants something that is generic, and only update the "cache" of it when it changes. I plan on writing it to a file, but I need some advice... - each input has 5 fields, so what would be the best way to seperate them in a file? I know I would just use explode to read it back into an array, but I need the "dividing string" to be something that would not occure in the input. Such as [|] . But there is always a chance that might appear. so question A) What is the best way to format my file. (maybe i should "escape" my explode text with preg replace?) question B) What would be the best way to "update" the file, without having to rewrite it. Ex if I want my file to hold the 5 most recent values, When a new one appears, I have to kick out the oldest. How could I efficiently do this? thanks! Link to comment https://forums.phpfreaks.com/topic/180920-what-is-best-format-to-writeand-update-cache-files/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.