Advice on views for comments system of very dynamic website |
Additionally, if loading of views becomes an issue for many results, there are a couple of ways that you can modify things to negate that performance hit and only load the comment view once.
The first would be to have the view simply contain a loop, and you pass all results to it at once, then the view just loops over all of the comments. The second way would be to have the view contain placeholders, much like you would find in a Mustache or Handlebars template, where the variables are wrapped in curly braces. Then, load that view up into a variable. Next loop over all of your comments, doing str_replace or strtr on the template to create the final output. Even past all of that, though, you can start adding in caching if needed, or a Varnish cache on the server, etc. As Mat said "start by building the page(s) using whatever structure makes sense to you at the time" and only worry about it if it becomes too much of an issue. There are quite a few ways that it can be tackled, so no worries. |
Messages In This Thread |
Advice on views for comments system of very dynamic website - by DreamOfSleeping - 07-16-2015, 03:53 AM
RE: Advice on views for comments system of very dynamic website - by JayAdra - 07-16-2015, 06:05 AM
RE: Advice on views for comments system of very dynamic website - by DreamOfSleeping - 07-16-2015, 06:32 AM
RE: Advice on views for comments system of very dynamic website - by mwhitney - 07-16-2015, 10:00 AM
RE: Advice on views for comments system of very dynamic website - by DreamOfSleeping - 07-16-2015, 10:13 AM
RE: Advice on views for comments system of very dynamic website - by mwhitney - 07-16-2015, 10:57 AM
RE: Advice on views for comments system of very dynamic website - by DreamOfSleeping - 07-16-2015, 11:09 AM
RE: Advice on views for comments system of very dynamic website - by kilishan - 07-16-2015, 12:20 PM
|