You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stalenessLevel is computed from the time of the last modification of the corresponding data file. Thus, in order to have the correct time value, we need that every new data are written to local file as soon as we receive it from the remote engine in iHotelAppMenuViewController viewWillAppear method. But this is not done sooner than in viewWillDisappear method.
This "post-write" strategy is taken also in AppCache cacheData:toFile: method, where (see [leastRecentlyUsedCacheData writeToFile:archivePath atomically:YES];) the data gets written to disk only after it can't remain in memory any more.
When combined with "pre-write" stalenessLevel concept, some stale data are declared as not stale.
Fix is rather simple provided one caching strategy will be chosen as preferred.
Talking about ch24/iHotelApp/iHotelApp/ directory.
AppCache.m:
stalenessLevel
is computed from the time of the last modification of the corresponding data file. Thus, in order to have the correct time value, we need that every new data are written to local file as soon as we receive it from the remote engine in iHotelAppMenuViewControllerviewWillAppear
method. But this is not done sooner than inviewWillDisappear
method.This "post-write" strategy is taken also in AppCache cacheData:toFile: method, where (see
[leastRecentlyUsedCacheData writeToFile:archivePath atomically:YES];
) the data gets written to disk only after it can't remain in memory any more.When combined with "pre-write"
stalenessLevel
concept, some stale data are declared as not stale.Fix is rather simple provided one caching strategy will be chosen as preferred.
Code excerpts follow.
iHotelAppMenuViewController:
AppCache.m:
The text was updated successfully, but these errors were encountered: