Unless you've benchmarked your application and found this to be a real problem, I wouldn't worry about loading a little extra code. Other issues will be more important. Does your site use authentication? Don't reauthenticate every page (seems obvious, I know, but I'm supporting an application that does this - and I can't change it because my group does not control the authentication module) - use Apache's native authentication or an encrypted cookie instead. Cache database queries when appropriate. Instead of keeping session information in the database or on the server, keep it in the user's (encrypted) cookie. Javascript, while annoying to write (and a possible accessibility issue), can help you avoid unnecessary hits on the server. For instance, instead of redirecting server-side, you can redirect client-side - instead of reloading the page to get a secondary drop-down list, create the list dynamically. I once wrote a file manager application that loaded the user's entire directory structure into a javascript hash - then the user could navigate through his/her directories without hitting the server again - javascript would rewrite the page as appropriate (this was necessary because the users were in South America with slow connections and the server was in New Jersey). If you duplicate (at least some) form validation client-side, you'll have fewer resubmits, which will lighten the load on your server (I said "duplicate" because you'll still have to do all the validation server-side, since you can never trust information from the client). If you're writing a web based application (file manager, mail client, quality record system, chat room, etc) rather than something people will want to bookmark (a news-site, blog, etc), frames (although unfashionable) might be appropriate - they divide the application into discrete units (for a three-frame application, usually main navigation, secondary navigation, and the active screen) and make it so you don't have to reload parts of that application that aren't changing. If you do use frames, be sure to include code to maintain frame state (if a frame is loaded independently, redirect to the frameset). Even if your project doesn't lend itself to frames, you can still cache sections of the page, like navigation, polls, etc.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.