MVC CSS Stylesheets

While working on redoing my website using a custom model-view-controller framework I decided that it was a good time to do some extra cleanup. After all, cleaning up the backend only changes the content portion of the site. There's much more to websites - styles, behaviors, cache control - then the content. In the interest of cleaning up my website I decided to take my MVC framework to the next level and use it to create my stylesheets and Javascript in real-time.

The primary benefit of MVC frameworks is to simplify code logic and remove duplicate code. With all user requests being transferred through the same routes and controllers, it's easy to whip out extra html pages or make site-wide changes by editing a few lines. Common SQL functions, AJAX calls, and classes can be used across different pages and sites easily without duplication.

There's a lot of duplicated code in my assets. I use Erik Meyer's reset stylesheet, a global set of style rules, jQuery, similar lightboxes, etc across my different subdomains. I could include each ...

read more »

Using Headers for Caching

One of my main goals while redoing my website is to optimize my content, both on the frontend and backend. The frontend is something that I've always considered to be the most important in terms of a fast user experience - I'm not crunching enough data on the backend to worry about long processing delays for users. However, depending on the connection, I've noticed delays upwards of five seconds in between pages, which is completely unacceptable.

There's a few things that a web developer can do to speed up the frontend. Decreasing the number and lowering the size of the unique elements are two of the most obvious. If the user only has to download two small stylesheets instead of five, your site will appear faster. What I wanted to do was take this a step further; repeat visitors will not have to download any new stylesheets, scripts, or images. The only http request will be the xHTML content. This can be handled by using the built in caching components of the internet.

There are several different ways that website can cache information ...

read more »

Website Overhaul

It may be no surprise to any of my long-term visitors, but I've decided to perform a deep overhaul of my website. Based partly on my recent introduction to model-view-control frameworks and partly on research into web caching and optimization, I've spent a good chunk of time analyzing my current and future website functions in the hopes of streamlining the backend code and optimizing the frontend. There are several goals that I have in mind for this overhaul, most of which will stretch my current programming skills.

Model-View-Controller Setup

The idea behind this sort of programming is breaking everything up into separate, reusable objects. All requests to the website are directed to a primary router, which interprets the request and pulls a controller to handle the page. A controller is a set of instructions based on the page type (example: home page, blog post pages, etc) that sets variables for the final page. The controller may talk to a model, which is the 'logic' for the site (usually a database object), and pull additional ...

read more »

Google Static Map API Introduction

On several of my previous blog posts I ran into the need to show something on a map. While Google Maps was the initial idea to implement, all I wanted was a single image with a few lines or markers. Embedding a map seemed a bit much for this simple task. My second idea was taking screen shots of a Google Map with the lines/markers displayed, which is probably copyright infringement. This last idea led me to my solution: Google's Static Map API.

I've worked quite a bit with Google Maps in the past and really enjoy their API. It's easy and fun to work with, and the end result is simply amazing. The Static Map API, while being more restrictive in features, is no different.

The first step is signing up for an API key on Google's Site. This key is tied directly to the domain that your project is on, so you'll probably end up creating a few keys. After this is done, you can embed an image on your site just like any other image.

read more »

Driving through the Huron Mountains

The roads in the Huron Mountains are the result of years of logging, recreation, and lack of maintenance. As the only maps of this area show all possible routes as random, haphazard wiggles, it takes time to understand which roads are drivable and which are barely fit for walking. Once you understand the main routes, though, much of the area becomes accessible by normal cars.

County Roads 510 and 550 connect Marquette to Big Bay. Big Bay Road, or Country Road 550, is the eastern one and is paved, more direct, and takes you past Sugarloaf, Hogback, Presque Isle, and other popular destinations. If you're looking for a more scenic route, 510 meanders further west but is gravel and require a respectable low speed. It does pass the Yellow Dog Falls and meets up with Blind 35 and the Triple A, although it doesn't actually go to Big Bay - you need to reconnect with 550 to do that. County Road 510 does have a bit of interesting history, as it was part of the planned route for M-35, the highway that Ford stopped. You can read about this on ...

read more »