PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Wed Jan 23, 2008 10:41 pm Reply with quote Back to top

Based on Guardian's recommendation, I installed the FireBug and YSlow extensions on Firefox. REALLY nice (though initially a tad confusing).

Of course, my recent problems with page load time (mostly, I think, due to an external JS file on another server) led me to test performance of a site first. Lots of bad grades, I'm afraid. One of the worst was uncompressed local JS files.

A quick search led to
Only registered users can see links on this board!
Get registered or login to the forums!
to handle it through most browsers (another addition to dot htaccess generator?). One JS went from 11K to 3K - NICE. Even better - when I view the JS (and presumably CSS, though I haven't tested that yet), using the JSView Firefox extension, the source is uncompressed. NICER! Although initial tests indicated that page generation time increased, subsequent tests indicated no substantial different in page generation time.

What if I "minified" it first, using something like
Only registered users can see links on this board!
Get registered or login to the forums!
? (there is also a PHP version that could do this on the fly) By removing comments and spacing, the 11K script went to 9K, and a 7K script went to 4K. Adding gz compression put these at 2K and 1K. So, these 2 JS files went from 18K to 3K! NICEST! (note: don't try viewing these scripts online)

Could there be an even better way?
Only registered users can see links on this board!
Get registered or login to the forums!
This looks promising, even if it requires PHP 5.2+ (another reason to upgrade?). But is this better? Not sure yet, though the caching and 304 responses are appealing. It claims to work with PHP gz modules, but it's not clear if that's a benefit. If the files are compressed, does minify do its thing to the uncompressed version? If so, that might be better for script writers since they wouldn't need to include both compressed and uncompressed versions - they could leave in comments for maintainability, compress and minify. Then again, we could just separate scripts for compressed / uncompressed sites.

So, before I invest any more time on this, has anyone else looked at this / found better options?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Thu Jan 24, 2008 9:09 pm Reply with quote Back to top

It's really scary. Maybe ESP? Or is it PHP killing me Anyway, for the last couple of weeks I've been all over the net looking into JS compressors. But, due to the release date I had to place it on the back burner. I'll just let you hound dog this one Wink
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Thu Jan 24, 2008 11:22 pm Reply with quote Back to top

You mean, instead of us both doing so, as with htaccesser? Cool
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Fri Jan 25, 2008 10:39 am Reply with quote Back to top

If it's just the two of us that are interested, I'll probably put it on the back burner, too.
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Fri Jan 25, 2008 10:54 am Reply with quote Back to top

No....I know I am intersted. My page load times SUX.

Dawg
View user's profile Send private message
technocrat
Life Cycles Becoming CPU Cycles


Joined: Jul 07, 2005
Posts: 511

PostPosted: Fri Jan 25, 2008 12:06 pm Reply with quote Back to top

The js minifying seems to only add minor speed increases. I couldn't get the gz compression to work for me I am not sure why.

I did notice a strong improvement by adding cache controls to the .htaccess file.

Code:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A0

# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(ico|flv|pdf|mov|mp3|wmv|ppt)$">
  ExpiresDefault A29030400
  Header append Cache-Control "public"
</FilesMatch>

# Set up caching on media files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|swf|bmp)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>

# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
  ExpiresDefault A7200
  Header append Cache-Control "private, proxy-revalidate, must-revalidate"
</FilesMatch>
</IfModule>
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

PostPosted: Sun Jan 27, 2008 8:37 am Reply with quote Back to top

So far I have only used the extension to help quatify potential problems and bottlenecks. Unfortunately, I have not had the time to delve into it any deeper with profiling etc to compare one method against another.
They are certainly very useful tools though and hopefully soon I'll be able to follow through.
View user's profile Send private message Send e-mail Visit poster's website
djmaze
Subject Matter Expert


Joined: May 15, 2004
Posts: 689
Location: http://tinyurl.com/5z8dmv

PostPosted: Tue Feb 26, 2008 12:20 pm Reply with quote Back to top

I wrote a very dаmn good compressor.
Problem is: you need to write dаmn good 100% valid JavaScript!

It doesn't scramble the function names like many others, it just rips out all spaces and uses gzip compression.

Problem with function name scrambling is that you could get 2 functions (each in a file) with the same name :p

P.S.: dámn is not allowed, and there are 1000's of ways to still write the word. including the following unicode character that i used but your browser probably doesn't understand: а
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Tue Feb 26, 2008 4:44 pm Reply with quote Back to top

djmaze, I'm pretty sure that's how (php) minify works (ie, it doesn't scramble).

Technocrat - which browser were you using where gz compression didn't work?
View user's profile Send private message
technocrat
Life Cycles Becoming CPU Cycles


Joined: Jul 07, 2005
Posts: 511

PostPosted: Tue Feb 26, 2008 4:55 pm Reply with quote Back to top

FF2
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Tue Feb 26, 2008 5:41 pm Reply with quote Back to top

Strange. I didn't have problems loading the compressed stuff on my site, where it's still compressed.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum