Latest 2.0.0
Homepage https://github.com/ChangbaDevs/KTVHTTPCache
License MIT
Platforms ios 8.0, requires ARC
Dependencies KTVCocoaHTTPServer
Frameworks UIKit, Foundation
Authors

KTVHTTPCache is a powerful media cache framework. It can cache HTTP request, and very suitable for media resources.

Flow Chart

KTVHTTPCache Flow Chart

Features

  • Thread safety.
  • Logging system, Support for console and file output.
  • Accurate view caching information.
  • Provide different levels of interface.
  • Adjust the download configuration.

Installation

Installation with CocoaPods

To integrate KTVHTTPCache into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'KTVHTTPCache', '~> 2.0.0'

Run pod install

Installation with Carthage

To integrate KTVHTTPCache into your Xcode project using Carthage, specify it in your Cartfile:

github "ChangbaDevs/KTVHTTPCache" ~> 2.0.0

Run carthage update to build the framework and drag the built KTVHTTPCache.framework and KTVCocoaHTTPServer.framework into your Xcode project.

Usage

  • Start proxy.
[KTVHTTPCache proxyStart:&error];
  • Generated proxy URL.
NSURL *proxyURL = [KTVHTTPCache proxyURLWithOriginalURL:originalURL];
AVPlayer *player = [AVPlayer playerWithURL:proxyURL];
  • Get the complete cache file URL if existed.
NSURL *completeCacheFileURL= [KTVHTTPCache cacheCompleteFileURLWithURL:originalURL];
  • Set the URL filter processing mapping relationship.
[KTVHTTPCache encodeSetURLConverter:^NSURL *(NSURL *URL) {
    return URL;
}];
  • Download Configuration
// Timeout interval.
[KTVHTTPCache downloadSetTimeoutInterval:30];

// Accept Content-Type.
[KTVHTTPCache downloadSetAcceptableContentTypes:contentTypes];

// Set unsupport Content-Type filter.
[KTVHTTPCache downloadSetUnacceptableContentTypeDisposer:^BOOL(NSURL *URL, NSString *contentType) {
    return NO;
}];

// Additional headers.
[KTVHTTPCache downloadSetAdditionalHeaders:headers];

// Whitelist headers.
[KTVHTTPCache downloadSetWhitelistHeaderKeys:headers];
  • Log.
// Console.
[KTVHTTPCache logSetConsoleLogEnable:YES];

// File.
[KTVHTTPCache logSetRecordLogEnable:YES];
NSString *logFilePath = [KTVHTTPCache logRecordLogFilePath];

License

KTVHTTPCache is released under the MIT license.

Feedback

Developed by Single

  • SGPlayer – A powerful media player framework for iOS, macOS, and tvOS.
  • KTVVideoProcess – A High-Performance video effects processing framework.

Latest podspec

{
    "name": "KTVHTTPCache",
    "version": "2.0.0",
    "summary": "A powerful media cache framework.",
    "homepage": "https://github.com/ChangbaDevs/KTVHTTPCache",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Single": "[email protected]"
    },
    "social_media_url": "https://weibo.com/3118550737",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/ChangbaDevs/KTVHTTPCache.git",
        "tag": "2.0.0"
    },
    "source_files": [
        "KTVHTTPCache",
        "KTVHTTPCache/**/*.{h,m}"
    ],
    "public_header_files": [
        "KTVHTTPCache/KTVHTTPCache.h",
        "KTVHTTPCache/Classes/KTVHCCommon/KTVHCRange.h",
        "KTVHTTPCache/Classes/KTVHCDataStorage/KTVHCDataReader.h",
        "KTVHTTPCache/Classes/KTVHCDataStorage/KTVHCDataLoader.h",
        "KTVHTTPCache/Classes/KTVHCDataStorage/KTVHCDataRequest.h",
        "KTVHTTPCache/Classes/KTVHCDataStorage/KTVHCDataResponse.h",
        "KTVHTTPCache/Classes/KTVHCDataStorage/KTVHCDataCacheItem.h",
        "KTVHTTPCache/Classes/KTVHCDataStorage/KTVHCDataCacheItemZone.h"
    ],
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "requires_arc": true,
    "dependencies": {
        "KTVCocoaHTTPServer": []
    }
}

Pin It on Pinterest

Share This