01-29-2008, 08:20 PM
|
#5 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
Let me explain why this is useful for me. The snippet above is a part of the API for a system, right? That means it will not change alot. So, in the main page you will have a menu, a footer and a sidebar perhaps. This is where the caching kicks in. 3 queries would need to be executed in order to have the list of pages in all the 3 places mentioned above. Then, perhaps a developer would need to add the links in another 2 places (like in the header and in a box somewhere on the website). He doesn't need 2 more additional queries, the system will use the existing one. Plus, there is going to be much more stuff like that going on in this system.
Personally, I wouldn't cache the queries like I would the pages because the queries may always change. Imagine a query changing, the page cache being regenerated (the html file), but still using the old query. You end up with a bunch of broken pages (until the SQL cache is being regenerated). Impractical.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|