EBDownloadCaching is a framework that includes several classes that implement performant HTTP downloading and caching; the various components are described below.
EBDownload is a class encapsulating a single-use download from a HTTP/HTTPS URL. EBDownload offers performant downloading by using libcurl under the hood, and provides a simple block-based interface to supply the resulting download data and status. Clients can use EBDownload directly to easily download the contents of URLs, or alternatively use the caching classes described below to add a layer of caching and avoid downloading data unnecessarily.
An EBDownload instance can be used safely from multiple threads simultaneously.
EBDownloadCache provides caching functionality for the data retrieved by an EBDownload, supporting two levels of caching: in-memory caching using NSCache, and on-disk caching using EBDiskCache.
EBImageDownloadCache is a simple subclass of EBDownloadCache that stores CGImages in its in-memory cache, instead of raw data.
- Mac OS 10.8 or iOS 6. (Earlier platforms have not been tested.)
- Integrate EBFoundation into your project.
- Integrate EBPrimitives into your project.
- Drag EBDownloadCaching.xcodeproj into your project's file hierarchy.
- In your target's "Build Phases" tab:
- Add EBDownloadCaching as a dependency ("Target Dependencies" section)
- Link against libEBDownloadCaching.a ("Link Binary With Libraries" section)
- Link against Security.framework
- Link against libz.dylib
- For products targeting OS X: link against libcurl.dylib
- For products targeting iOS: link against ImageIO.framework
- Add
#import <EBDownloadCaching/EBDownloadCaching.h>
to your source files.
EBDownloadCaching was created for Lasso.
EBDownloadCaching is available under the MIT license; see the LICENSE file for more information.