For our sanity, please make sure that your pages are short and quick to load using these methods, or we may never come back:
To try and keep your main page short
- Check the length of all files that are loaded from your main page. The length to aim for is 40K* or less, 100K or less with a background sound.
- For JPEGs, load them into Paint Shop Pro and resave them, except when you Save-As, click on the options button and make sure that the Compression level is set to a high number (say, at least 75) (or the applicable setting in your graphics program.)
- For GIF drawings, using a minimum of colors will make the file smaller.
- For GIF animations, use a minimum of frames.
- Keep your backgrounds as short as possible. If you have a border, however, make sure your graphic is at least 1024 pixels wide, and use a 1x1 spacer graphic to get your text beyond the table.
- Imagemaps are your friend. You then only need one graphic file rather than 10.
- Use the IE PreLoader control to load future pages. (See IE Preloader)
- Use the minimum number of graphics. If you can, reuse your graphics.
- Use .mid files rather than .wav files if possible. If you have a large .wav sound, use RealAudio instead. (See RealAudio tip)
- Check out these links on WebMonkey for more help: Part 1, Part 2, Part 3, Part 4.
To try and keep other pages short
- Don't repeat the same graphic menu as the main pages. Just link back to the home page or make a <TABLE> menu in text.
- This time, you are aiming for 25K or less.
- The graphics and scripts tips still apply.
- If a page can be split, split it!
To keep pages generated by scripts short and quick
- Detect the browser and send code appropriately. Don't send scripts to those browsers that don't handle it.
- Try and pregenerate pages that take a lot of processing time (sorted views of a database, for example). crontab is a good thing to learn how to use in this case.
- the less \n's printed out the better, just make sure your HTML code is readable.
- The player for .wav and .mid files should be VISIBLE. Background music that cannot be turned off is an annoyance at best.
- Avoid the <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> line. I've heard it makes Netscape try and reload the page. Edit it out of any file that was created by an HTML editor.
- If you know HTML, use a text editor where you can change the source at your leisure.
You can make longer pages and sounds appear quick with these two tips.
Say your file is at http://mission.net/usa/test-mission/MyMissionSong.ra. Create a new text file, and just type your file's URL into it on the first line, with no spaces before it. Rename it with a .ram extension, like MyMissionSong.ram. Make sure that your ram file is what you link to, and RealAudio will psuedo-stream the file using the HTTP protocol.
If you have a .wav file that's over 35K or so, you should get RealEncoder or whatever they call it nowadays. Use it carefully and it'll shrink your sound files a lot.
RealAudio has an ActiveX object and a Netscape plugin interface, as well, if you wish to have your music play automatically.
It's a nice object to use. What it does is it loads pages and graphics you'll need later while the main page is loading.
To use it, add this code just above the </BODY></HTML> line.
<OBJECT ID="Preloader1" CLASSID="CLSID:16E349E0-702C-11CF-A3A9-00A0C9034920"
ALIGN="baseline" BORDER="0" WIDTH="1" HEIGHT="1">
<PARAM NAME="_ExtentX" VALUE="2461">
<PARAM NAME="_ExtentY" VALUE="1032">
<PARAM NAME="URL" VALUE="History.html">
<PARAM NAME="enable" VALUE="1">
You only need the line with CODEBASE in it the first time you use it in an HTML file. The ID must be different every time, and the URL should be the file that you'll need on the next click.
This only works for people using IE 3.0 and above, but that's at least 80% of the browsers currently clicking on mission.net, I understand.
Do NOT load files currently on the page, that's just wasted time!
* For page size limits, I'm including the .html file, the .css file, all .jpeg and .gif files in IMG SRC or BODY BACKGROUND links, and any .wav or .mid files automatically loaded in the page.