Managing blocks in a responsive theme I'm just starting a responsive theme based on Omega, concentrating on the mobile layout at first.

There are certain blocks that will probably be deemed too 'heavy' to include on the mobile layout, and other blocks that will need to be introduced specifically for that layout (watered-down menus, toned-down user-bar etc).

I could easily hide the unwanted blocks on the mobile layout with CSS, and include the mobile-specific blocks on the default layout and hide those (so they're only shown for mobile), but that seems like quite a backwards way of thinking about it. If the blocks aren't shown, the extra overhead they incur would really be unacceptable (especially considering the number of extra db queries that the content in hidden blocks would add).

I'm thinking there must be a nice clean way to intercept the block decision-making process early on in the page build, and exclude/include blocks based on some os-detection, but I'm drawing a blank on how that might be possible.

I'm also going to throw in the fact that Varnish is running in front of this site, which should make things more fun :)

Are there modules/known strategies out there that can help with this?

I should add that using the Context module isn't an option as the site is already fully-fledged, and moving it into Context would be a massive undertaking at this point.
I can't go into a lot of details, as I've not used either module for ages (I build all my sites with Context from the word go and I've not picked up responsive on something I haven't built for a while, so I've not had this problem before), but I think you should be able to put something together with Mobile Tools and Spaces. 

Spaces


  Spaces is an API module intended to make configuration options generally avaliable only at the sitewide level to be configurable and overridden by individual "spaces" on a Drupal site. It has been described as:
  
  
  A way to make one Drupal site act like several sites
  A way to provide much more configurable, full-feature Organic Groups or user homepages
  A generalized API for contextual configuration
  


Mobile Tools


  The Mobile Tools module provides Drupal developers with some tools to
  assist in making adjustments to your site based on the visitor's
  device.


The project page for MT does say it's not ready for production though, which might be a problem - it depends when  it was last updated, as the last commit was this month.

*EDIT

I COMPLETELY FORGOT ABOUT THESE!

Browscap


  Browscap provides an improved version of PHP's get_browser() function.


Browscap block


  Browscap Block adds visibility options to block configuration settings
  to allow you hide or show blocks in mobile devices.


Browscap does depend on your server setup, but if you can use it then the second module gives you extra visibility settings for each block on the block edit page.