Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2004, 04:45 PM
ShiningArcanine ShiningArcanine is offline
 
Join Date: May 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default RealTime Template Compressor

Hey could someone port this to vB3:

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

I'd really really like this.
Reply With Quote
  #2  
Old 01-17-2004, 05:55 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When time comes, it will be ported to VB3 by its author.
Reply With Quote
  #3  
Old 01-17-2004, 06:21 PM
Koutaru's Avatar
Koutaru Koutaru is offline
 
Join Date: Feb 2003
Location: IL
Posts: 589
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks Logician
Reply With Quote
  #4  
Old 01-17-2004, 06:38 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 01-17-2004, 08:43 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 01-18-2004, 04:27 AM
ShiningArcanine ShiningArcanine is offline
 
Join Date: May 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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. ^_^;;
Reply With Quote
  #7  
Old 01-18-2004, 08:25 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 01-18-2004, 10:48 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@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.
Reply With Quote
  #9  
Old 01-18-2004, 10:53 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok great, I'll look into it, thx!
Reply With Quote
  #10  
Old 01-18-2004, 02:00 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:51 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04982 seconds
  • Memory Usage 2,259KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete