When developing a site with a responsive CSS design, your site changes the way information is presented based off the client's screen size. In many cases, smaller screen sizes mean that less information is displayed.
Lets say you have a site designed for the desktop. In your server-side code, you make several database queries and then on the pages you display that information in some form.
Now, lets say your CSS design in responsive and some information is not shown to devices with small screens. Lets say that some of that information is that is not shown is from database queries. What this means is that when a mobile device loads up this page, the server-side code is making unnecessary database calls because the resulting information isn't going to be shown to the end user because of their screen size.
Responsive Design typically uses CSS media queries to determine what information is shown based off of device screen size. What is a good approach to writing effective and efficient server-side code for responsive designs?