diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache+Extension.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache+Extension.swift index 13df18d..4827882 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache+Extension.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache+Extension.swift @@ -135,7 +135,7 @@ extension PersistentCacheManager { } @objc public extension MVMCoreCache { - + @objc func shouldSaveAtAppLevel(infoDictionary:[String: AnyHashable]) -> Bool { guard let cachePolicy = infoDictionary[KeyCachePolicy] as? Dictionary, @@ -145,8 +145,19 @@ extension PersistentCacheManager { self.isJSONExpired(infoDictionary) == false else {return false} return true } + + @objc func getPathForPersistentCachePage(pageType: String, isAppLevel appLevel: Bool) -> URL?{ + + if appLevel { + + return PersistentCacheManager.shared.appLevelCacheDirectory.appendingPathComponent("Pages").appendingPathComponent(pageType).appendingPathExtension("json") + + }else { + + return PersistentCacheManager.shared.cacheDirectory.appendingPathComponent("Pages").appendingPathComponent(pageType).appendingPathExtension("json") + } + + } + } - - - diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m index ae6c4fd..d7113f6 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m @@ -141,15 +141,6 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt"; return [self shouldPersistentlyCacheJSON:jsonDictionary]; } -- (nullable NSURL *)getPathForPersistentCachePage:(nonnull NSString *)pageType isAppLevel:(BOOL)isAppLevel{ - - if (isAppLevel) { - return [[[[PersistentCacheManager shared].appLevelCacheDirectory URLByAppendingPathComponent:@"Pages"] URLByAppendingPathComponent:pageType] URLByAppendingPathExtension:@"json"]; - } else { - return [[[[PersistentCacheManager shared].cacheDirectory URLByAppendingPathComponent:@"Pages"] URLByAppendingPathComponent:pageType] URLByAppendingPathExtension:@"json"]; - } -} - - (nullable NSURL *)getPathForPersistentCacheModule:(nonnull NSString *)moduleName { return [[[[PersistentCacheManager shared].cacheDirectory URLByAppendingPathComponent:@"Modules"] URLByAppendingPathComponent:moduleName]URLByAppendingPathExtension:@"json"]; }