Skip to content

Instantly share code, notes, and snippets.

@jestan
Created October 31, 2011 05:05
Show Gist options
  • Save jestan/1326942 to your computer and use it in GitHub Desktop.
Save jestan/1326942 to your computer and use it in GitHub Desktop.
Dispatch Http Caching
#Http Caching
trait HttpCache extends Http {
override def make_client: org.apache.http.client.HttpClient = {
val config = new CacheConfig
config.setMaxCacheEntries(500)
config.setMaxObjectSizeBytes(50000)
new CachingHttpClient(super.make_client, config)
}
}
val http = new Http with with HttpCache with thread.Safety with NoLogging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment