@@ -124,7 +124,9 @@ - (void)parseWithCacheKey:(nonnull NSString *)cacheKey
124124 [videoItem resetImagesWithProtoObject: protoObject];
125125 [videoItem resetSpritesWithProtoObject: protoObject];
126126 [videoItem resetAudiosWithProtoObject: protoObject];
127- [videoItem saveCache: cacheKey];
127+ if (self.enabledMemoryCache ) {
128+ [videoItem saveCache: cacheKey];
129+ }
128130 if (completionBlock) {
129131 [[NSOperationQueue mainQueue ] addOperationWithBlock: ^{
130132 completionBlock (videoItem);
@@ -148,7 +150,9 @@ - (void)parseWithCacheKey:(nonnull NSString *)cacheKey
148150 SVGAVideoEntity *videoItem = [[SVGAVideoEntity alloc ] initWithJSONObject: JSONObject cacheDir: cacheDir];
149151 [videoItem resetImagesWithJSONObject: JSONObject];
150152 [videoItem resetSpritesWithJSONObject: JSONObject];
151- [videoItem saveCache: cacheKey];
153+ if (self.enabledMemoryCache ) {
154+ [videoItem saveCache: cacheKey];
155+ }
152156 if (completionBlock) {
153157 [[NSOperationQueue mainQueue ] addOperationWithBlock: ^{
154158 completionBlock (videoItem);
@@ -200,7 +204,9 @@ - (void)parseWithData:(nonnull NSData *)data
200204 [videoItem resetImagesWithProtoObject: protoObject];
201205 [videoItem resetSpritesWithProtoObject: protoObject];
202206 [videoItem resetAudiosWithProtoObject: protoObject];
203- [videoItem saveCache: cacheKey];
207+ if (self.enabledMemoryCache ) {
208+ [videoItem saveCache: cacheKey];
209+ }
204210 if (completionBlock) {
205211 [[NSOperationQueue mainQueue ] addOperationWithBlock: ^{
206212 completionBlock (videoItem);
@@ -253,7 +259,9 @@ - (void)parseWithData:(nonnull NSData *)data
253259 SVGAVideoEntity *videoItem = [[SVGAVideoEntity alloc ] initWithProtoObject: protoObject cacheDir: cacheDir];
254260 [videoItem resetImagesWithProtoObject: protoObject];
255261 [videoItem resetSpritesWithProtoObject: protoObject];
256- [videoItem saveCache: cacheKey];
262+ if (self.enabledMemoryCache ) {
263+ [videoItem saveCache: cacheKey];
264+ }
257265 if (completionBlock) {
258266 [[NSOperationQueue mainQueue ] addOperationWithBlock: ^{
259267 completionBlock (videoItem);
@@ -277,7 +285,9 @@ - (void)parseWithData:(nonnull NSData *)data
277285 SVGAVideoEntity *videoItem = [[SVGAVideoEntity alloc ] initWithJSONObject: JSONObject cacheDir: cacheDir];
278286 [videoItem resetImagesWithJSONObject: JSONObject];
279287 [videoItem resetSpritesWithJSONObject: JSONObject];
280- [videoItem saveCache: cacheKey];
288+ if (self.enabledMemoryCache ) {
289+ [videoItem saveCache: cacheKey];
290+ }
281291 if (completionBlock) {
282292 [[NSOperationQueue mainQueue ] addOperationWithBlock: ^{
283293 completionBlock (videoItem);
0 commit comments