Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Reducing the size of js scripts
Old 03-13-2008, 08:19 PM Reducing the size of js scripts
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
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!
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
 
Register now for full access!
Old 03-13-2008, 08:26 PM Re: Reducing the size of js scripts
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 03-13-2008, 08:38 PM Re: Reducing the size of js scripts
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
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.
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Old 03-13-2008, 08:53 PM Re: Reducing the size of js scripts
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
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?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-13-2008, 09:02 PM Re: Reducing the size of js scripts
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
Do you have any ideas or examples for a simple server-side gallery?
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Old 03-13-2008, 09:47 PM Re: Reducing the size of js scripts
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 03-13-2008, 09:56 PM Re: Reducing the size of js scripts
wildbackpacker's Avatar
Extreme Talker

Posts: 162
Name: Colton
Location: Utah, USA
Trades: 0
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.
__________________
Colton
Wild Backpacker

Please login or register to view this content. Registration is FREE
wildbackpacker is offline
Reply With Quote
View Public Profile Visit wildbackpacker's homepage!
 
Reply     « Reply to Reducing the size of js scripts
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
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.69423 seconds with 12 queries