Server-side Browser Detection with Bootstrap

    One thing I love about bootstrap is that it eliminates the need to create separate views or pages to handle both types of clients (mobile/desktop) . A few years back when Asp.net MVC 4.0 first came out and before the big boom of "mobile first" styled css libraries there was a huge additional feature for server side detection. Now this was back in the early parts of my career so I was not sure where this feature would fit in or if it would ever. Since then I have been looking at all types of frameworks and server side detection systems but ultimately have been moving toward the bootstrap style mentality until I looked at my blog. Blogger actually does all the work for me so I didn't have do anything to create this.
    The thought behind this is to minimize the amount of information you sent to the user. Its great that you hidden it to the user on mobile devices and even design it with them in mind. However they are still getting all that information, which seems like a waste of bandwidth. The performance gain from this might be minor for most pages but depending on your needs could make a huge difference. This is just an idea and something that I am working on creating. Some might say this is pointless or counter productive with a already mobile ready stylesheet but like I explained in some cases by doing this would greatly improve mobile bandwidth.

How it would work?
    How I see this working could be one or two ways. The first is that on a request and looking at the class attributes. Remove all that are "hidden-xs" and "hidden-sm" elements. The other approach which I think is better but kinda goes against what I like about using bootstrap. Which would require me to create two html pages but I could use node to dynamically build this second page just to save some response time from the server. Also this second html would only be for the server not need to check it into the repository or create it local unless I'm debugging.


Popular posts from this blog

Nginx Best Practices Extended

Installing Windows on Acer chromebook 15 cb3-532

Entity Framework: ToListAynsc & WhereAsync