Skip to content

Instantly share code, notes, and snippets.

Avatar

Jens-Christian Fischer jcfischer

View GitHub Profile
@johnthethird
johnthethird / http_client_with_cache.coffee
Created Sep 1, 2010
HTTPClientWithCache for Titanium in CoffeeScript
View http_client_with_cache.coffee
###
------> HTTPClientWithCache <------
This class is a wrapper around the standard Titanium.Network.HTTPClient(), but it adds a
few nice features:
* A cache backed by a SQLite database. All HTTPClientWithCache instances use the same database table, with
the primary cache key being a hash of the full URL (and any data parameters in a POST)
* The cache is automatically pruned before each query
* A retry mechanism, so that you can retry a particular query a number of times before failing.