Vote Charlie!

April 2012 Archives

Simple PHP file caching

Posted at age 23.

Note to self that might be useful for others doing really basic stuff:

Often I use Random Web Service’s API to get a JSON file of data repeatedly, but that file doesn’t need to be refreshed 600 times a second. I can then use a simple PHP script to store the file and retrieve it from disk until it gets to be a certain age.

Read more