|
Posted by webcm123 on 06/23/07 17:21
I'm making some changes in files structure in my CMS. I will use more
templates for modules. However, the topic of <title> and other ...
came back when i was thinking about it.
---- Pre-generating (A) ----
It uses output buffering. Modules files are included before <html>.
The whole middle output (e.g. article with comment, registration
form) is stored in RAM (or SWAP :D) and prepared for putting it into
the main layout inside <body>. Menus aren't stored in "output
buffering" memory.
Advantage:
:: <title> and <head> content may be set using variables
Disadvantage:
:: Wideli (significantly) more RAM usage (e.g. 10 simultaneous
requests for 50 kb = 500 kb).
---- Generating step-by-step ----
All modules are included from the main layout from PHP basing on MOD
constant defined by index.php. However, there is additional file for
"content" modules (articles, files, images, free subpages and news) -
content.php - which gets data from database (about their category
also) and sets <title> if user have access to them. For another
modules, index.php sets <title> automatically if $lang['module_name']
exists, e.g. $lang['users']. Perhaps, "View user: anonymous" title
isn't as important.
Advantage:
:: Lower RAM usage (big contents aren't stored twice)
Disadvantage:
:: Most modules can't access <head> content
Some people often avoid items in Google if they can't see bold title.
However, does it concern other modules than "content" modules (e.g.
user - username, poll - pollname, news archive)?
Navigation:
[Reply to this message]
|