Symfony2:缓存管理API [重复]

This question already has an answer here:

I use Symfony2 to build a website that will request data from a web service. Requests are made from the server (not the client). I would like to use a cache mechanism to store the responses received from the web service, so that I do not issue the same request again and again.

Is there an API in Symfony core to manage files in cache ? I would like to use the /app/cache directory but cannot find the best way to do this. I could write files directly into this directory, but then I will not benefit from the automatic environment management.

</div>

Doctrine cache can be a solution for you as mentioned in comment of your question.

But for this kind of needs HTTP caching seems better, you can use symfony2 built-in reverse proxy or a soft like varnish

Symfony2 related documentation : http://symfony.com/doc/current/book/http_cache.html

Tutorial for nginx + varnish + wordpress ( just as an exemple ) : https://www.digitalocean.com/community/articles/how-to-install-wordpress-nginx-php-and-varnish-on-ubuntu-12-04