Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
High performance reverse proxy, employs memcached for caching
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


Middleman is a reverse proxy which supports regex refreshes and employes memcached as the backend. Middleman was written because varnish didn't work very well for our use case.

  • Varnish employs local RAM hence cannot hold large working sets
  • More Varnish servers means more origin traffic due to cache misses. It adds up.
  • Local cache also create cache coherency problems
  • Varnish monitoring is not at par with what we get from newrelic


  • Middleman employs distributed memory (memcached)
  • Supports regex invalidation
  • Supports url refresh
  • Awesome performance
  • Quickly enable memcached cache on apps without coding

Design Principles

  • As much as possible, do things in background
  • Use memcached to exploit distributed memory

User guide

To run middleman configure middleman webapp in Jetty, Tomcat, Resin, etc. Middleman is configured via a properties file. Specify origin server and memcached nodes in the configuration file. Origin servers is where Middleman will get the content from when it's not found it cache or it needs to refresh a url. Memcached nodes are used for caching.

Refresh a URL

Middleman allows a url to be refreshed on-demand


Invalidate via regex

Middleman allows urls to be invalidated by specifying a regex. Middleman maintains a list of regex rules for refreshTimeout period and if the url matches a regex, then it asynchronously refreshes the url when it was being requested.



Middleman is configured via ign/middleman/config/middleman-${environment}.properties under WEB-INF/classes where environment can be specified via System Property environment (Example: /ign/middleman/config/ The default value of environment is development.

#memcached hosts comma separated list of host:port
#memcached cache timeout
#After refresh timeout has expired, the middleman proxy will return the 
# stale data from memcached and schedule a background update
#http connect and read timeouts in ms
#cached rules time out in s
Something went wrong with that request. Please try again.