Transparent caching of API calls for PHP