|
|
|
|
|
by hackernewz
5608 days ago
|
|
Sounds like really bad coding taken to another level. At some point in your program you will know which thumbnails are needed for the page. Instead of structuring that logic and commenting it well, perhaps even turning it into a sub-system or library, you pepper the templates with database calls. And then, you waste more CPU time by scanning the full HTML output of a page multiple times. This is like AJAX all on the server side. All the hassle of async processing with none of the benefits. |
|
We don't scan the HMTL either, this system doesn't have templates, this is another point of the technique. The data structure holding the output contains both DOM and objects precisely to avoid a templating syntax, which would be costly to scan.
The tree that contains intertwined objects and DOM is only traversed once, when it's echoed. The data resolution is done in passes, but doesn't require traversing the "output" tree.