The ever expanding universe of client side file types required to run modern web applications has presented a relatively new form of bloat in the computing world. When you access a website these days many resources are loaded behind the scenes to give the user a pretty interface and rich usability experience. However, the richness of these web interfaces sometimes comes at a heavy cost to app performance. Just look at a web page analyzer, like the one included in Google Chrome, when you visit a site such as CNN.com. Just visiting the home page requires 200 different resources like JavaScript, CSS, and image files to be loaded by the browser! The 1 MB of data represented by these files is seemingly minuscule given the massive disks and fat network pipes most of us have these days. But when you split a response over 200 separate transactions, the browser and web server have to do A LOT of work. When you start adding in richer (i.e. fatter) file types like Flash FLV or Flex SWF files performance becomes even worse. These files, which happen to be the subject of this post, can be in the many MB themselves! We don’t want to download these files every time we hit a site (assuming they don’t change frequently) and that’s where the HTTP Response header “cache-control” comes into play.
Caching web files to improve performance is by no means a new idea. The cache-control directive used to do just that has been around since HTTP1.1 which was released in 1999! However, the mechanism by which you apply cache-control is often times cumbersome and limiting to this day. Caching client files is typically done with property files on the web or application server. Hard coded expiration dates or max age directives (how many seconds the file should be cached for) are used. But what do we do when we don’t have a specific expiration date or a simplistic age rule to apply to the cache? What if we don’t want to update the web server configuration every time we want to change our rule? What if we want to apply the cache rule in a dynamic fashion?
Typically, a Flex SWF file is embedded with an object tag where the src is set to your SWF file name, e.g. example.swf. When your browser sees this reference it requests and downloads the SWF file. Now SWF files are generally considered to be static resources by your web or app server. That means the response headers that return this file are generally controlled by the web server alone which leaves you with web server configuration as the only apparent choice to set cache-control on a SWF. However, if you return the SWF in binary form via a JSP, ASP, PHP, etc. you can use that dynamic page to manually set the response header! What that means is, in the case of a JSP for example, you could introduce a cache control rule with:
request.setHeader("Expires", <>);
This requires you to set the src on your embed tag to your JSP file, e.g. example.jsp, instead of your example.swf file. Will this work? The answer is no, unless your JSP file returns the SWF as a BinaryOutputStream (or the equivalent in other languages.) This means you must first read the SWF file through an InputStream and then write it to the JSP response with the OutputStream. The code to do that is as follows:
<%@ page import="java.io.*" %>
<%@ page import="java.net.*" %>
<%@page contentType="application/x-shockwave-flash" %><%
OutputStream o = response.getOutputStream();
InputStream is =
new URL("http://myserver/example.swf").getInputStream();
byte[] buf = new byte[32 * 1024];
int nRead = 0;
while( (nRead=is.read(buf)) != -1 ) {
o.write(buf, 0, nRead);
}
o.flush();
o.close();
return;
%>
Now, set your src target on your embed tag to your JSP and Voila! You now have the ability to programmatically control the HTTP response headers on your SWF or FLV file.
For those Android users out there who want to turn their phone or tablet into a free Google Voice phone, Talkatone has recently released a version of their software for the Android OS! The software is technically in a preview mode which means it’s not completely ready for primetime. However, I have been using it for a few weeks now on my Acer Iconia tablet and the basic phone and text functions work rather well. It is definitely more temperamental than the iOS version, but it does the job.
If you want to learn more about Talkatone for the Android, go here to learn more and download the latest APK file. In order to install the APK you may need to ‘sideload’ it into your Android though Talkatone informed me you can install it to the Acer Iconia directly from their website. The way I sideload Android applications onto my tablet is via a File Manager application. The aptly named “File Manager” application on the Android Market works well. You can download it here. Once you have that, download the APK file onto your Android device and navigate to the Download folder via File Manager. Simply click the APK to install it.
Talkatone certainly has more work to do on its Android application, but this is an important step towards greater independence from the cell phone carriers like AT&T and Verizon. Good luck!
Bill Gross thrives on turning innovative ideas into pioneering companies. He serves as founder and CEO of Idealab, which started over 75 companies since 1996. In this stimulating lecture, he shares how Idealab continues to bring incredible ideas to market, and his personal insights on starting and running successful organizations. Gross also describes the work of eSolar, a spin-off company of Idealab that works to make solar energy cost-competitive in the global marketplace.
This article will explain how I replaced a monthly mobile phone and text plan with a Google Voice + WiFi Hotspot combination. Google Voice allows you to send and receive free unlimited domestic phone calls and texts and international calls/texts for a very low rate. I recently did this with my family’s mobile phone plan at home and estimate a savings of around $100 per month. The savings may be much more for someone who has a high or no limit voice / text plan, which can cost upwards of $100 or more per month. Before you decide to replace your cell service with my solution, however, please read the following disclaimer:
Disclaimer: I make no guarantees to the quality of service or actual savings you will achieve using this solution. Voice Over IP (VoIP) service providers, including Google Voice, do not offer 911 service for emergency calls. I will explain how I was able to retain 911 service, but I make no guarantee that the same approach will work for you. Use at your own risk.
With that out of the way, let’s get started.
Overview
My setup at home uses a combination of Google Voice, a MiFi hotspot (on Verizon’s 4G LTE network), and an iPhone with WiFi enabled. The MiFi hotspot gives my iPhone access to the internet which is all you need to access your Google Voice account. Google Voice, through an application called Talkatone, acts as my mobile phone for calls and texts.
My setup includes:
* An iPhone (w/ No Service Plan)
* A 4G LTE MiFi Wireless Hotspot from Verizon
* The free Talkatone App from the iTunes App Store
Each component is discussed in more detail below.
Using an iPhone
In my personal setup I am using an iPhone that was part of an AT&T mobile plan that we canceled. This is an ideal device because it can dial 911 even without an active cell plan. An iPhone is not necessary however to get free domestic phone calls and text messages with Google Voice. You can use the same setup on an iPod Touch or iPad, though you would need a separate device, such as an AT&T GoPhone, if wish to retain the ability to call 911. If you decide to cancel your current mobile plan as I did, just remember that your service provider may charge you an early termination fee if you’re still under contract.
Choosing a MiFi Hotspot
For those of you unfamiliar with them, a MiFi hotspot is essentially a WiFi router that connects to the internet over a cellphone network. Once online, you can connect up to 5 WiFi devices, such as laptops, iPhones, iPads, etc to this local network and use it just like you use your home WiFi network. For VoIP applications, the more bandwidth you have, the better. Though you can technically use Google Voice with a 3G MiFi hotspot, a 4G device is highly preferred. I have used both and the occurrence of dropped or low quality calls is significantly higher on a 3G network. I have yet to experience these issues with my 4G device.
I chose to use a Verizon 4G LTE Samsung MiFi hotspot to support my VoIP setup because only Verizon offers 4G in my area. AT&T offers 4G in other areas of the country though so I have provided coverage maps for Verizon and AT&T below for your reference.
If you live in an area with 4G coverage, I recommend going with whatever provider offers it. If you only have 3G coverage in your area, you may want to wait until 4G is available before attempting to replace your cell plan with this Google Voice based solution.
Click on the map below for more detailed coverage information.
Verizon’s 4G LTE Coverage Map
At&t4G Coverage Map
MiFi Performance on 4G LTE
The data rates on the Verizon 4G LTE MiFi device are blazing fast. On my first day using it I was able to achieve rates of nearly 11 mbps down and over 4.5 mbps up. The performance varies but it is always significantly faster than 3G data rates and faster even than many people’s home networks. The only way to tell how the MiFi will perform in your area is to try one out. Verizon will actually let you borrow a device for a day if you go into a Verizon Wireless store and sign a release form! If you don’t want to go through the paperwork to borrow one for a day, you can also test one out in the store. This is a great way to find out how the device will work for you before committing to buying one.
Data Plans & Pricing
Whether you choose Verizon, AT&T, or another carrier for your MiFi hotspot you will need a data plan. My Verizon 4G data plan is $50 / month and caps me at 5GB. This may or may not seem like a lot of data to you depending on your specific usage. I ran dozens of tests on my first day with the device including phone calls, texts, and various other network usage and used only about 30 MB, so for my usage, 5GB will be plenty. You will need to judge for yourself if that is sufficient or if you need a more robust data plan. Verizon and AT&T offer tiered data plans at higher monthly rates.
Buying the Device
I highly recommend that if you decide to buy a MiFi you do so at a Best Buy. They have a buyer’s remorse policy that will allow you to return a Verizon device within 14 days and an AT&T device within 30 days without getting locked into your contract or being stuck with the device. If you buy directly from a wireless branch of the provider, you might get stuck with a device or contract you decide you don’t want!
Carrying the Device & Battery Life
When I tell someone about my MiFi / G-Voice setup they first ask, “Isn’t it a hassle to carry the extra device (the MiFi)?” For me, the answer is no, it’s not. The Verizon 4G LTE MiFi fits snugly into my standard sized men’s leather wallet. A picture of the wallet closed with the MiFi in it is included here to demonstrate.
The second question I get is, “How long does the battery last?” So far, my experience has been that I get about 5 hours of battery life while actively using the device, which is what Samsung rates the device for. To me, I found this was a surprisingly long battery life. I do keep the USB charging cable with me in my bag in case I do run out of juice, but I must do the same thing for my iPhone as well, which gets less than 5 hours of active use time these days.
Other Uses
As I mentioned earlier, the MiFi hotspot can host up to 5 WiFi connections at a time. For me, this is a huge added benefit of carrying the device. I commute to and from work each day about 40 minutes each way on a light rail system that remains above ground and within Verizon’s 4G coverage area for most of the trip. In the past, I would pass the time on the train by browsing news articles or listening to NPR on my iPhone. Now, I spend it mostly working on my laptop on things that typically require an internet connection such as checking my corporate email or working on my blog. This is a plus of the MiFi that should not be overlooked.
Google Voice
You’ll need to setup a Google Voice account and download Talkatone (or another application like it) to make and receive calls and texts on your device. Getting an account is easy. Just visit Google.com/Voice and follow the instructions to setup a new Voice phone number.
Google Voice has tons of cool features like voicemail transcription, customized greetings, and call routing rules that can be configured by caller or time of day. I’m not going to go into all the things you can do with Google Voice, but you can find out more when you setup your account. Once you’ve configured your account you need to download Talkatone or another Google Voice based phone application.
Talkatone Talkatone is a really neat application available on the Apple App Store that let’s you send and receive calls and texts on your Google Voice telephone number. Visit the App Store or this link to install it. Talkatone has lots of cool features as well that I won’t go over in this post. When you install Talkatone, make sure to read the setup instructions carefully. You’ll need to make sure that you’re logged out of Google Chat from Gmail and from the Google Voice iPhone app (if you have it) so your calls and texts are correctly routed to Talkatone. Refer to the documentation that comes with the Talkatone application for complete instructions on setting up and using Talkatone. Note:Talkatone is currently available for Apple devices but they will be releasing and Android version shortly!
Bringing It Together Now that you have all of the pieces in place you’re ready to start using Talkatone to send and receive phone calls and text messages. If you’re committing to this solution as I have, I recommend replacing your Phone app in your bottom menu with Talkatone as pictured here. Just remember to keep the actual Phone application handy in case you plan to use it for 911 as I am.
Selecting the application will bring up an application that looks very similar to what you’re probably already used to. Dialing numbers and sending text messages with Talkatone is just as easy as doing it with a normal iPhone. If you’ve configured everything correctly you’re now ready to go and hopefully on your way to saving lots of money!
Good luck to you and feel free to contact me if you have any questions or wish to share any feedback.