Reputation: 967
I'm currently developing a website which will have heavy load, and a certain amount of data.
Over 40000 articles, 300,000 comments, 3,000,000 votes.
Some data need to be real time, like article'votes, article's comments while other may be delayed, like weekly top article (based on votes), or latest articles on the homepage.
I'm using Doctrine 2, and it is possible to set up a cache driver, however basic configuration will apply to all data, like lifetime.
My question then is first, where do you set up cache ?
I'm using an SOA like application, then I've an ArticleController, an ArticleService, and an ArticleRepository.
Second, do I need to set it up manually for each data depending on the realtime constraints and estimated traffic/update frequence?
Thank you.
Upvotes: 2
Views: 249
Reputation: 3128
If you add Zend_Cache to application.ini or bootstrap.php your intent is to cache the whole web site with all HTML page. You can use Zend_Cache in many different ways, though. You can use it to catch DB queries and much more. I have Zend_Cache setup in one action controller and can successfully catch the whole HTML page just for that particular action.
Upvotes: 0
Reputation: 238189
You can setup you caches in application.ini or Bootstrap.php. I think that application.ini is easier.
In ZF you can choose from few cache frontends (what to store) and backends (how to store) your data. Usually, in one ZF web app you use mixture of them (especially frontends) as they have different properties or purposes. For example, File frontend which can be used to cache config files, is automatically cleared whenever config files are modified. So it is a part of your design process to decide what and how to cache, when to clear caches etc.
Upvotes: 1
Reputation: 11200
Bootstrap.php is the place to setup your caches and register them. It would seem you need to separate caches articule, comments and votes. Each cache can then have it's own reload timeouts for view and db queries. Goodluck and read up on Zend_Cache
Upvotes: 0