Simple cache function for PHP