The Top 5 Things You Should Be Doing
Chris Missal, August 23, 2007
This is my list for August 2007 on things that should be done with your website. They are ideas or concepts that I find sites may be lacking at the time of writing this article.
5. Use appropriate tags.
Why on earth would you ever put your navigation links in a table? It's important to maintain the definition of the (X)HTML tags. If you want a list of links displayed on the right side of your page, please do not put them inside a <table>. A table is meant to display tabular data, rows and columns. Most everybody knows this can be achieved using tables, but you're creating a list, so use the <ul> tag. It stands for Unordered List. I see this far too often and you may be sick of all the lectures, but a table uses more code and can't have its style mofidied nearly as easily as a list. For more ranting, check out Why tables for layout is stupid. For more tag references and what is and is not deprecated, check out the W3 Schools tag reference page.
4. Create robots.txt and sitemap.xml pages files
You wan't a robots.txt file on the root of your site. This file tells web crawlers what pages to look at and what pages not to look at. If you can't think of a good reason you wouldn't want a bot to index certain pages on your website, you're not thinking hard enough. For more information, visit the RobotsTxt.org website. In addition to the robots.txt file, create a sitemap.xml file for your site. They're not hard to make and there is plenty of information on them through Google Webmaster Tools and the site Sitemaps.org. This file lets search engines what you think of the pages on your site. Which ones are most important and how often they should be indexed.
3. Certain data should be semi-dynamic
There are certain sets of data that you want to be able to maintian but doesn't necessarily deserve a database call. These sets of data are items that are regularly used, but seldomly updated. Take the following instance.
You're developing a site that sells Bicycles and currently they sell BMX, Mountian and Racing Bikes. You'll always hear words such as "eventually we..." or "in the future...". Most times people will want to add-on or expand their market. This bike shop wants to start selling Folding bikes sometime next year. If the categories of bikes aren't going to change for around a few months or so, why is it necessary to query the database every page load to get these choices? There are many decisions that can be made as to which is the best way to handle something like this.
It's decided to store the categories in an Xml file so that it could be used for other purposes if need be. When a request is made to load the data you can check the file's modified date attribute, if it was modified over 24 hours ago, or whatever amount of time suites your needs, call the necessary code to re-create the file, then open it. This can be done on a request-to-request basis, thus not needing to be automated.
Check out Autogenerate XML from MySQL in PHP, for a PHP/MySQL/ XML example of this.
2. Process Data After Page Load
You need to log some data when a user requests a page. You don't need to process it before serving the page. Collect your data, build a request, send the request. It's not often you need to receive something back from logging data. For example, I track browser usage and screen resolution, etc. I simple collect the data and build an AJAX call. From then on, it could take 3 minutes to insert it into the database (I certainly hope it never does) and it wouldn't any impact on the user.
1. Separate Content & Design
Not all projects can afford to have designers and developers. Even so, it's important to maintain the same mindset. The HTML served to a request should contain as little logic as possible (maybe that's why the job is given to designers, just kidding). I've always tried to keep intact the MVC concept of application development. Lately I've been trying to find a fourth component to this. Without doing any research I'm thinking of something like "Data-Logic-Structure-Presentation". Basically splitting the view into two parts, the skeleton and the style. I know this isn't new thinking, but with the ease of use of CSS on HTML and XSL on XML it's much easier to accomplish.
This article contains external links that are not affiliated with DumpsterDoggy.com.













