This question was probably asked before, but I cannot decide yet on what I should use. I'm building a small API Wrapper and there are some methods that could use some caching of the data I get with that method.
The data is in JSON format. So while I was browsing I found a few solutions to store this data. One of them is APC, which seemed pretty neat and more like using localStorage on the client side. But then I found that this is an extension that doesn't come with PHP preinstalled, and for the latest versions of PHP there are some bugs ( the developers don't consider it stable ). I also had a hard time adding it to XAMPP so I can test it locally.
So I left it out and considered other options like creating files on the server. This also seemed like a pretty good idea until I discovered that when I create a folder, the chmod
is 0755
which isn't very convenient. I first thought it was something I did, but then I read a post here saying something about Safe Mode, which doesn't allow me to create folders with 0777
mode. So I was looking for a solution and I found that using FTP would solve it. I tried the FTP thing and it worked just fine, just that I had a hard time implementing a way for the connection to remain opened until it timed out and don't overwrite the connection each time I called the method that connected to FTP and created the folder.
Another solution I heard about is Memcache if I'm not mistaken, but that seemed like an overhead.
So I'm a bit in doubt on what I should use for caching the data. If anyone has some pointers it would be appreciated :)