tags:

views:

41

answers:

1

I have made a framework for a project. The project does a medium amount of query requests (but the traffic it will be getting will make it more per user). The views are mixed HTML and PHP.

Just looking for the best minimalist ways on how I should go about caching my view files (the controller uses output buffering so maybe I can leverage that?) and cache my queries. I've looked around but only could find big/bloated libraries or very crude methods on doing these things, something I'm not interested in.

Thanks for the help!

A: 

You can try to cache complicated views like lists etc.

An example: You have a category overview, it shows the name of all categories and the count of items in it. You can cache this view as static html as long as no new item has been inserted or deleted in any category.

So every time you create a new item or delete one you have to regenerate this view.

Since items are created less often than being viewed, you can save many queries ;)

PS: You don't have to use files for that, you could use memcache (google for it)

sled
Thanks. Yeah makes sense. Thanks!
aibot