I'm creating a simple caching library in PHP. Currently, when I store a value I create 2 files: One that contains the value and another one to store the creation time. I want a robust solution and I'm not sure how safe it is to use the file date attributes. Do you think is safe to use the file date attribute for expiry time, instead to store it in a separate file?
It will be OS dependent? I want my library to behave the same on windows and linux.