Reply
Reducing the size of js scripts
Old 03-13-2008, 07:19 PM Reducing the size of js scripts
odha's Avatar
Skilled Talker

Posts: 83
On one of my pages, http://www.outdoorhighadventure.com/thekalalautrail.htm, I have a script for photo albums. According to http://www.websiteoptimization.com, http://www.outdoorhighadventure.com/slide.js is double the size of my actually page. Now I don't know if this is normal, or what, but is there a way to reduce the size of this script? I thought I should have my external scripts under 8K, but the script is 47086 by itself. Any help on this would be great. Thanks!
odha is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 03-13-2008, 07:26 PM Re: Reducing the size of js scripts
Learning Newbie's Avatar
Moderator

Latest Blog Post:
My Wish for Webmaster Talk
Posts: 5,181
Name: John Alexander
You could start removing stuff from the script. Delete lines, or entire functions. That will surely make the script smaller in size.

Probably won't accomplish what you want, tho, which is a working site. In other words, you might have to just accept a big external file. Browsers should cache it after the first visit, which means it isn't a big problem anyway.
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 03-13-2008, 07:38 PM Re: Reducing the size of js scripts
odha's Avatar
Skilled Talker

Posts: 83
Thanks. So I take it there is no way to 'compress' scripts? Is there something else that I can do to speed up http://www.outdoorhighadventure.com/thekalalutrail.htm? I've optimized most of my images, removed images, and other things, but it is still pretty slow. Thanks.
odha is offline
Reply With Quote
View Public Profile
 
Old 03-13-2008, 07:53 PM Re: Reducing the size of js scripts
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
There is a way, but for the most part it's been done on that script already. They took out all the spaces and returns, which makes the code a godawful mess, but it's as close to "optimized" as it's probably going to be.

The problem with that particular script is that it seems to do way too much in an odd way. Yeah, it creates a cool slideshow effect in the page, but why not just have a simple server-side gallery that would accomplish the same thing, not confuse users, provide more entry points to your site, and in general pose a better solution?
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-13-2008, 08:02 PM Re: Reducing the size of js scripts
odha's Avatar
Skilled Talker

Posts: 83
Do you have any ideas or examples for a simple server-side gallery?
odha is offline
Reply With Quote
View Public Profile
 
Old 03-13-2008, 08:47 PM Re: Reducing the size of js scripts
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
I'm looking forward to your Zion Narrows page. I don't see an rss feed, though ... you should shoot a note when it's finished. And you should consider adding a feed so people who like what they see, or are just interested in general, can stay up to date.

It looks like you're being too aggressive trying to optimize for bandwidth or file size. People who are attracted to hiking and the great outdoors in general like to go sight seeing. Big images are probably a good idea. At least that's my take on the situation ... my site is painful on dial up, but I think both of us are going to attract readers with broadband connections.

A server side image gallery is going to look just like a client side gallery; you're just moving the logic to the server, to avoid having to send it down on every request.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 03-13-2008, 08:56 PM Re: Reducing the size of js scripts
odha's Avatar
Skilled Talker

Posts: 83
I'll let you know about the Zion Narrows, although I am currently working on improving Buckskin Gulch and Coyote Gulch. Also, I'll look into starting a feed (I'd have no idea where to even start). Thats a good tip about the photos, I'll try to find a good place in between speed and quality. Do you recommed switching to a server side? Honestly, I don't know what you are talking about with that. If I am using a script that I host what is that called, and on my Buckskin Gulch page for instance, I am used Box.net to host my photos. Is that server or client side? sorry I'm new at this! Also, my hosting service doesn't provide PHP support.
odha is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Reducing the size of js scripts
 

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15992 seconds with 12 queries