dpuwov1487 2014-01-06 17:47
浏览 122

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>
  • 写回答

1条回答 默认 最新

  • dso407787736 2014-01-07 09:12
    关注

    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

    评论

报告相同问题?

悬赏问题

  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?