vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Template Compressor (https://vborg.vbsupport.ru/showthread.php?t=91769)

VBCoder 07-07-2005 01:58 AM

Template Compressor
 
PROBLEM: Pages are produced with huge amounts of white space, comments, etc., bloating the HTML, load time, and bandwidth.

SOLUTION: Compress it. Remove whitespace, etc.

PROBLEM: This takes CPU time.

SOLUTION: Precompress the templates. That is, store two copies of each template. A "master", which is showed when you edit, and a "compressed", which is generated each time you save a new template (or edit one), without whitespace and comments. The compressed one is actually used.

Anyone up to the challenge?

Biker_GA 07-07-2005 02:06 AM

https://vborg.vbsupport.ru/showthread.php?t=83248 ;)

Dream 07-07-2005 02:10 AM

the same template content is stored in two columns, not sure why, one is used in eval() I think, you could compress that one I think

Biker_GA 07-07-2005 02:13 AM

With compression -

Powered by vBulletin Version 3.5.0 Beta 3
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.

[Output: 25.91 Kb. compressed to 24.95 Kb. by saving 0.96 Kb. (3.69%)]
Page generated in 0.09913 seconds with 8 queries [Server Loads: average: 0.50, 0.81, 0.85 0.50 : 0.81]

Without compression -

Powered by vBulletin Version 3.5.0 Beta 3
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.

Page generated in 0.09982 seconds with 8 queries [Server Loads: average: 0.61, 0.74, 0.81 0.61 : 0.74]

VBCoder 07-07-2005 02:35 AM

Biker, I saw that plug in, but it compresses each page as it is served. As I said, this could be further optimized by just compressing the template. See PROBLE #2.

(I have in mind some additional compressions, that would take more time, and hence are best done only once).

Biker_GA 07-07-2005 02:39 AM

Quote:

Originally Posted by VBCoder
Biker, I saw that plug in, but it compresses each page as it is served. As I said, this could be further optimized by just compressing the template. See PROBLE #2.

(I have in mind some additional compressions, that would take more time, and hence are best done only once).

You may wish to read the hack again. It is a template compressor. Not a page compressor.

Andreas 07-07-2005 02:43 AM

Quote:

Originally Posted by Dream
the same template content is stored in two columns, not sure why, one is used in eval() I think, you could compress that one I think

Performance :)

PHP obviously doesn't understand <if> ... <else />, <phrase>.
So this has to be parsed into native PHP Calls, and if this would be done for every Template upon every Page Call it would be a mjaor performance hit.


Compressing the Templates Offline is a good idea, unfortunately there a a bunch of Problems - JavaScript for example.


All times are GMT. The time now is 11:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01817 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete