vb.org Archive

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

ShiningArcanine 01-17-2004 04:45 PM

RealTime Template Compressor
 
Hey could someone port this to vB3:

https://vborg.vbsupport.ru/showthread.php?t=56589

I'd really really like this. :D

Logician 01-17-2004 05:55 PM

When time comes, it will be ported to VB3 by its author.

Koutaru 01-17-2004 06:21 PM

;) thanks Logician

Logician 01-17-2004 06:38 PM

I didnt work on this yet so this is just a thought but this hack can be problematic in VB3 though. VB3's javascript/DHTML structure is more sophisticated than VB2 (eg. WYSIWYG post area etc.) and removing spaces/new lines can cause some bugs. We'll see when I start to work on it. :)

Andreas 01-17-2004 08:43 PM

I think it might be a good idea not to do this realtime, but when the templates are being parsed for conditionals (eg. in process_template_conditionals).

This way there would be no overhead when serving pages :)

Does anybody have figures about the decrease when GZIP (level 1) is enabled?

ShiningArcanine 01-18-2004 04:27 AM

Quote:

Originally Posted by Logician
When time comes, it will be ported to VB3 by its author.

I'm sort of new to the forums so I had no clue you were still around to port it. ^_^;;

Logician 01-18-2004 08:25 AM

Quote:

Originally Posted by KirbyDE
I think it might be a good idea not to do this realtime, but when the templates are being parsed for conditionals (eg. in process_template_conditionals).

This way there would be no overhead when serving pages :)

I didnt check VB3 algorithm extensively yet but I'm not sure if it helps. The hack needs to apply a "preg_replace" to the page output code and I think it wouldnt matter in which step and where you apply it. It will add a very small amount of overhead at the moment it runs regardless of its location, dont you think?

The only workaround is to compress the template when it is formed and save the compressed form in database. It will save the overhead then but I think it will be a very bad idea because templates will be unreadable to the admin in the edit page as well. :)

Andreas 01-18-2004 10:48 AM

@Logician
It you take a look at the table template, you will see that vB3 keeps two versions of each template in database: Unparsed for editing reasons (field template_un) and a parsed one (template) which is being used for actual page generation.
So if you put your code into process_template_conditionals the compression will be only done "once" (each time a template is being saved to database).

This way, there would be no overhead when serving the pages, but the original layout (for editing) could still be preserved.

Logician 01-18-2004 10:53 AM

ok great, I'll look into it, thx! :)

Princeton 01-18-2004 02:00 PM

Quote:

Originally Posted by KirbyDE
@Logician
It you take a look at the table template, you will see that vB3 keeps two versions of each template in database: Unparsed for editing reasons (field template_un) and a parsed one (template) which is being used for actual page generation.
So if you put your code into process_template_conditionals the compression will be only done "once" (each time a template is being saved to database).

This way, there would be no overhead when serving the pages, but the original layout (for editing) could still be preserved.

that's a great idea!
-----------------------------------
Jelsoft has taken giant steps to make vB3 more adaptable; but, it has taken quite a few steps back when implementing javascript into to many of it's pages. They should have placed all javascripts into external files.

To take full advantage of the compressor you should compress EVERYTHING (even javascript and css). However, if you do this the user should be aware that they must remove all comment tags from any javascripts found within templates.

This could be an option to the user - COMPRESS JAVASCRIPT?, yes/no, 1. And give instructions to search for <!-- || --> || // -- they all must be removed.

I'm looking forward to the new release. :)


All times are GMT. The time now is 11:00 AM.

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.01150 seconds
  • Memory Usage 1,738KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete