Started to look at forum code speed recently and size of scripts (js and CSS mainly).
There are many resources free online these days and although i used some for work i never bought them back home to CiC, well i started doing it here too so currently i am "Minifying" scripts - this mean taking out all the white space (spaces, carriage returns and comments) along with any code shortening ( #000000 only needs to be #000 ) which compresses the script by anywhere from 30-60% so they load and execute more quickly.
This does have its drawback if you then need to edit as you are looking at a block of code which is really hard to read so you can "beautify" scripts which add spaces and returns back to make them easier to read.
I am currently working on a principle that JS is something i don't often bother to code and as long as it works i just want it to load faster so i minify the locally stored scripts using:
http://jscompress.com/
and if i need to look at it later i can always run it through:
http://jsbeautifier.org/
With CSS i don't fully compress it just check it for shortened code most of the time as i change it so much and leave comments in it to help me keep track (adds a little loading time but cuts down adjustment time) so i use:
http://www.cleancss.com/
but don't enable all features.
Some code doesnt benefit from being minified (PHP and server side run script in dot.net) but some can reduce loading times and make the site feel faster.
Feel free to post any useful tools for code compression you have under this thread
Minifiers & Beautifiers
Moderator: Emmz
- red_ned
- CiC-GoD
- Posts: 4757
- Joined: Sat Nov 24, 2007 2:23 am
- DayZ Name: Hobn0b
- Contact:
- Kop
- CiC Clan Leader
- Posts: 3486
- Joined: Fri Jan 11, 2008 5:14 pm
- DayZ Name: Kop
- Location: Mansfield
- Contact: