A delightful iOS and OS X Networking Cache Managing Class
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
MGCacheManager.xcodeproj
MGCacheManager.xcworkspace
MGCacheManager
MGCacheManagerTests
Pods
How-it-works.png
LICENSE
MGCacheManager.podspec
Podfile
Podfile.lock
README.md

README.md

MGCacheManager

-A tool to manage caches with expiry date.

Advantages : -Improves any Application performance requires caching content or Apps relaying on HTTP API.

*** NOTE ***

Recommened to implement this Class just with GET methods.

Response Timing Test

First Run Response Time 1.891051 sec

Second Run Response Time 0.025160 sec

Workflow

Workflow

#Example for Request ( Using AFNetworking )

 #import "MGCacheManager.h"

 + (void)getPosts:(void (^)(id JSON))complete
{
	id cache = [MGCacheManager loadDataFromCacheFileNameKey:@"posts"];
	
	if (cache) {
		complete(cache);
		return;
	}
	
    [API sendGetPayload:nil toPath:@"posts" withLoadingMessage:nil complete:^(id JSON){
        
		complete([MGCacheManager saveAndReturnKeyResponse:JSON key:@"posts" cachePeriod:LONG_CACHE_DURATION]);

    }];
}

Any issues or recommendations , please contact me or open a new issue