[eluser]vtx220[/eluser]
Hello good folks of the CI forums =)
I wanted to know what do you think would be the most efficient way to display data on a webpage without having to query everything beforehand. In other words, on-demand queries.
Here's an example of how a tab could look like:
[Latest][Oldest][Most Viewed]
-------------------------------------
#This is the most recent article
#This is the second to most recent article
#this is the third most recent article
I'm sure that if this were to scale to hundreds of users at a time, it could pose a lot of CPU strain with so many queries if it were all queried at once.
THE THEORY:
The theory is that each tab would load specific controllers when clicked (or default loaded) which would then query the database for whatever the tab wants, and then output it in the container.
I'm not sure if this would work yet, but I assume that it could. However, doing it this way, is it efficient? Obviously it's a whole lot better than doing dozens of queries per page. Thoughts?
Edit: When I say "loading specific controllers" I mean it could easily be within the same controller that the current one is loaded from such as /home/index & /home/recent