How to cache in Symfony 2?

后端 未结 5 2244
既然无缘
既然无缘 2020-11-29 18:20

I need to cache some application specific data using Symfony 2\'s caching system so that I can run cache:clear to clear it. All the cache relies under app

5条回答
  •  北海茫月
    2020-11-29 18:44

    There is no partial cache in Symfony2, the build-in cache is full HTTP only. You have to use a reverse proxy, and if you only want to cache a piece of code, you have to use ESI. It's maybe more work than with symfony 1 but performances worth it.

    Anyway, nothing stop you to use a memcached and store some stuff in it, look at this Bundle i.e. If as your question state it, you only have data to store, that's perfect (and a memcache cache is much faster than a filesystem one).

提交回复
热议问题