Using IFR at Sprint
Introduction
This lengthy article is here to describe the process of how Shaun Inman’s IFR technique came to be used on Sprint.com and SprintPCS.com. This is my first write-up of the process involved in implementing a major new standard, and I didn’t take the notes I should have along the way… so please bear with me.
While the majority of Shaun’s IFR script (revised) has been re-written for our own use, the basic concepts are already described in his articles above about how it works. Not all of our pages are updated to use the flash headings yet, and may not be for some time (CMS integration and the like). On Sprint.com, the business section is using it, and on SprintPCS.com most of the shop side is using it (ex: 1, 2, 3, 4, 5), but not Manage (yet).
This all started when Shaun first launched IFR on his site, not his official documented launch linked above, but when he first started using it on his site. A co-worker, France, noticed it and sent me the link. We were quite impressed and discussed how cool it would be to use on our sites here at work. At that time we used one of the first FIR techniques for all H1’s and H2’s across the site which ended up being hundreds of titles and the maintenance was insane.
We discussed it kind of as a cool concept and left it at that, thinking that the “powers that be” wouldn’t go for such a prominant Flash element being used across the site. But when I went home that night, I couldn’t enjoy my TV shows, I couldn’t game (*sigh*) and I couldn’t sleep because I couldn’t get the concept out of my head. It was ruining my life. I came back in the next morning and spent every extra second I had on figuring out how I could make it work for us. I went through every line of his script and picked it apart to see what made it tick. In the end, I thought that it was something that was doable.
Difficulties abound
After making an initial draft of the script and discovering that I actually had a clue about what was going on in it, we started coming up with issues that we would need to overcome for it to work on our site. Several of them we thought were insurmountable, and would make it so that we couldn’t complete the project. But thanks to many great discussions where we just talked things out, and bounced ideas off of each other, we were able to overcome each problem that was presented. This was a great testament to working as a team and not being afraid to ask for help. I will go through each of the problems that I can remember, and what we did to overcome them.
- Special Characters - The most troubling issue we saw at the outset was the need to compensate for was our extensive use of special characters in our copyrighted, registered, trademarked, and service marked product names. This is where I first went to our resident Flash guru Lars Hacking to see what he thought. This one gave us the biggest hang up. He had some great ideas, and started tinkering in his free time at how to make it happen. To compensate for characters that are not easily passed into flash, I check for those characters and replace them with characters we are fairly certain that we won’t need as themselves (ie: ~`{}[]). Then on the Flash side, Lars takes them and puts in what it is supposed to be there.
- Our grid - Our site is based on a grid that we must follow. We have 3 columns for the content, and a given module can span 1, 2 or 3 of those columns. So the swf files had to vary in width to fit in the size of module they were currently in. To do this I walk up the DOM structure (many thanks to PPK and his invaluable site) checking the className’s of each parent until I find one with one of our specific class names that designate width. Once that is found (and I know which one it is), I can set the width that I have to work with and go from there.
- Underlined H2’s - We have two different kinds of titles, plain text, and underlined. To compensate for this I did the same DOM walking above to see if we were inside of a container that had the className that would dictate an underlined version.
- Two-line H2’s - We have some instances where we allow our graphical h2’s to wrap to two-lines. Using the same technique that Lars uses for counting in the flash, I find the actual width of the text in question (by character, specific to our font) and if it is greater then the width found in “Our grid” above I know to switch to the 2-line .swf version. We do not allow 2-line underlined headings, so luckily we didn’t have to compensate for that mixture. As an FYI, H1’s are not allowed more then one line either.
- Error headings - Our error module has different font and background colors. I again walk the DOM to find the container we are in, and then pass along the hex of the colors to be used for this given module. The flash then applies the passed colors to the output.
- FOUC - We noticed (as did Shaun’s readers) that there was a breif Flash Of Unstyled Content before the flash headings kicked in. To compensate for this, immediately after the flash version check is done, we load a .css file that updates the headings to be white text so that they are not seen. So we aren’t really eliminating the FOUC, but changing it to something that you can’t really see. We also add a second script (could be a few lines really, but using a remote script gives us better future control) to the end of the page that tells the Flash functions to fire. This saves us a little more time by firing before the “onload” goes, just in case a single graphic is holding things up or something. We set a variable to make sure that we don’t run it again “onload”. This way the second file is optional, and can only help if it is used.
- Content behind the flash - Our H1’s sometimes sit on top of graphics. To be more pleasing to the eye, the graphics will some times come up into the H1 row, when there is room for it to do so. With Flash transparency not being completely sound, we couldn’t just allow the H1 swf to go the full width of the module overlapping the parts of the image that came up into the H1 space. We had to use the text width determination mentioned above to determine the width of the text and then call an associated swf file that was sized close to that width (rounded up to the nearest 10px). So we had 20 some odd templates for each width between 170-360.
Selling it to the people in authority
After getting the majority of the above squared away so that we could be confident in saying that this is a solution that we could accomplish, we set up a meeting with our Web Standards comittee to show them this crazy idea. Some of the points we were sure to make are as follows:
- Stats for our site say that more then 90% of our visitors had the Flash version we were targeting
- This would save tons in labor costs
- This would make our turn around time much faster
- There would be graceful degredation for those without flash, using our accepted “non-image” standards
- There would be very limited code impact, as all we have to do is add the call to the .js file on any page we want it to work on. No need to go back to each heading and edit anything (as long as the page was built following our established structure)
- Did we mention the large reduction in cost??? =)
We must have put just enough “stuff” in their coffee cause they said “ok… go ahead and test it”. So we put up a few test pages in production to see if anyone would notice, or complain. We asked some visitors if anyone saw any issues on the pages in question. A few noticed the FOUC, but after the fixes were put in place mentions of that problem went away. Only one user (at sprintusers.com) noticed that we were using Flash, and that was because he had an extension on Mozilla that put an icon on any Flash elements on the page (asked him in a PM about it for those who can’t find mention in the thread).
After a few weeks of the above, we met again to discuss the results. We had received no complaints, were able to show the results from the above informal forum polls, and had a few improvements to show over our first meeting. They continued to like it (nothing in the coffee this time) and said they would take it to the people who paid the bills. Since bill payers like numbers, below are some of the numbers we provided to give to them. These numbers are just educated guesses, and I am not sure how far off from reality they are.
Bandwidth
26 K Savings in shop.css code (when we finally remove all reference to graphic titles)
8 k Savings in heads.css code (when we finally remove all reference to graphic titles)
20 K Savings in the actual graphics (average of .5k each X 40 titles per session [total guess])
54 K Total savings per visitor
With an average of 8 Million visitors per month, if on the low end we figure that they each download things only once, and then it’s cached for the rest of the month… we save 432 Gig a month of traffic. With a conservative estimate of $1.00 per Gig, that is $5,000 in annual savings. If we go to the other extreme and say there is NO caching, and every file is downloaded every time, we are looking at 7,000 Gig savings a month, for an annual savings of $84,000. The true amount lies somewhere in between.
Server Load
We will be switching from 3-5 unique titles per page, to 6 total files that will cache for all pages. Doing some math off the top of my head, that should save us 472 Million file loads per month (130 Million page views per month X 4 titles per page = 520 Million vs 8 Million visitors X 6 files = 48 Million files loaded). This doesn’t even consider the Safari bug that loads all 300-500 graphics each time they view a page that won’t be an issue any more. I can’t venture to guess how this will effect server performance, and how that transfers into a dollar amount.
While we were in beta testing with this project, Shaun released his articles on how to implement his IFR solution. We were able to gleen a few tidbits from the article to reduce our flash file count from 40+ to 6 or so which helped alot.
The above are based off our current standing. It does not consider additional titles and size associated with them that could be added throughout the year.
Work load
Guesses that are probably on the low side:
- VizD’s save 30-40 hrs a year
- Code save 60-80 hrs a year
If you did a conservative estimate of the time to create, cutout, save, add to code, add to stylesheet, test, check in, etc… for each title, we figure around a total of 5 minutes per image.
An example: A recent business site re-launch, which consolidated and simplified 7,000 pages, started with the flash titles from the get-go. In the end they had 1,253 H1’s and 3,841 H2’s. At the above average of 5 minutes per image… that is over 400 hours of time saved. If you figure a professionals time at $50/hr that is a $20,000 savings for this project alone. (wish I could say the check was in the mail Shaun… but you know how it goes;)
After all of the above, we got approval to move forward with using it on the site and it has become a standard to be used across the comapny. Naturally something like this doesn’t happen over night, so we have been updating what we can, when we can. The above business site launch was a huge proof for the technique in both ease of use, and cost savings. More pages will come online as they are edited, and as we find ways to get it put into existing Content Management Systems.
Bring it on home
To sum up… our old process for adding a new title was along the lines of the following:
- Put text inside of h1 or h2 tag
- Try and find the title we wanted in our current list of titles in the .css file (an occasionally alphabetized list, that had a few different naming conventions introduced to it as we went along)
- If we didn’t find it in the list, request the title from our Visual Designers
- Get the image from VizD, rename as appropriate and place in the correct folder
- Add a line to the .css file with a unique ID for this title.
- Add the above ID to the .html file
- Check the .html, .css and .gif file into cvs
- Since the above are in different directories… go back and check in the ones you missed or forgot to flag correctly.
- “Enjoy” the fruits of our labor
The new process
- Put text inside of h1 or h2 tag
- Check .html into cvs
- Enjoy the fruits of our labor
Gotta love the simplicity.
Thanks and praise go to Shaun and his innovative thinking and willingness to share with the community (even though I was trying to steal it before he offered it up *gulp*). While our script is 99% re-written, it is still IFR at it’s heart. Many thanks also go to all those involved with this project at Sprint for making it happen. In no particular order… France, Lars, Candice, Jenney and Kirk.
If anyone actually reads this, maybe I’ll do a future article breaking down the actual code and why I did things the way I did… then the REAL guru’s can come in and tell me how to do it better =)
www.sprint.com/business - a CSS mega-relaunch
More Sprint CSS Goodness™ - featuring Inman Flash Replacement.
First came the sprintpcs.com redesign, then the sprint.com homepage, then some here, there, everywhere. And now, introducing Sprint Business, housing all business-oriente…
Hear hear! I smell an A List Apart article a-brewin’.
I really liked seeing the cost analysis here, something that us designers dont always take into consideration… thanks for the write up!
Thanks for the breakdown! FIR is truly intriguing and an ongoing fascination for me. We’ve been entertaining the idea of integrating the technique into the next build of our CMS would love to see a more detailed article discussing your approach, especially regardibg deviation from Shaun’s approach. Great work! Thanks!
Great job! As you know, I’ve been pimpin IFR, and particularly Mike Davidson’s take on it — sIFR on my site. The kind of information you’ve given here is exactly what most people arne’t “getting” about IFR. I think a lot of people are just saying, “What’s the big deal? Why is this better than using an image?”
Those people are thinking about their personal site that has 10 headers total that are static and never change. When you start talking about CMSs, huge corporate sites, dynamic headers, and constant updates, you begin to realize why IFR makes so much sense.