PHP Classes

Template engine issue

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Template engine issue  
Subject:Template engine issue
Summary:Need quality regex for javascript cleaning
Messages:3
Author:Goran Bogdanovic
Date:2011-04-07 19:23:21
Update:2011-04-11 04:47:37
 

  1. Template engine issue   Reply   Report abuse  
Picture of Goran Bogdanovic Goran Bogdanovic - 2011-04-07 19:23:28
I'm almost finish new Template Engine for CMS I work on. I will release it on phpclasses.org for few weeks. I must say something about it. Complete template shortcodes handle PHP and serve as arrays to Template Engine.

-Server side caching.
-Client side caching.
-Page content gzipped.
-Meta data handle Template Engine.
-CSS and JS code optimized, combined and gzipped in 2 files.
-Page Speed 97 points, YSlow 97 points.

Almost perfect, but...

I have problem with cleaning Javascript files. I implemented 3 libaries for that purpose.

-JavaScriptPacker
-JSMin
-JShrink

also I have native JS handler without compression. Problem with all JS minify libaries is same HEAVY SERVER LOAD, EXTREMELY LONG FIRST ACCESS PAGE LOAD TIME. Anyway I try few things, but without success. Anyway I will leave this as possibility for end user. Also when I use Prototype.js mine JS code is not working.

Where I have problem is regex for JS code removing comments, white space...
I must say that I know to write regex but for this I didn't manage to get script to work after that.

Any suggestion is welcome and also I can send code for review.


Thank in advance



There are 2 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.