Clarity, Technology, and Solving Problems | PracticeThis.com
WP7 App with Key Windows Azure resources – Slides, Videos, How-To’s, and T-shooting – for quick consumption on the go.
Quick Resource Box
In this post I will share how to improve User Experience by reducing the number of HTTP 401 and HTTP 304 responses.
In general HTTP 304 is returned by web server when the browser is not really sure about up-to-date’ness of the resource. Imagine this conversation:
This one extra roundtrip might look very subtle in case when there are very few static elements on the page. In case there are many static elements on the page the User Experience can be severely affected. Below is an extreme example of HTTP 304 responses captured by Fiddler. All the images in the diagram are stored in local cache but they never displayed right away – Browser first consults with the server and gets HTTP 304 before displaying it:
HTTP 401 returned when Browser requests a resource that requires authentication. The fact that the resource requires authentication results in two HTTP requests – initial requests gets HTTP 401 asking for credentials, and subsequent request is satisfied with the actual response after the creds were validated. Something similar to this:
Consider the following solution structure:
<?xml version="1.0"?> <configuration> <system.web> <authorization> <allow="*"/> </authorization> </system.web> <location path="Restricted"> <system.web> <authorization> <deny="?"/> </authorization> </system.web> </location> </configuration>
This configuration achieves the following: