artifacts / AFCache

AFCache is an HTTP cache for iOS and OSX seeking towards full RFC2616 compliance
Apache License 2.0
361 stars 43 forks source link

Cache-Control no-cache #5

Closed dqueffeulouatw closed 13 years ago

dqueffeulouatw commented 13 years ago

I think you should check for "no-cache" in Cache-Control also (AFCacheableItem) :

    // parse cache-control header, if given
    if (cacheControlHeader) {

        // check if max-age is set in header

        NSRange range = [cacheControlHeader rangeOfString: @"max-age="];
        [...]           

        // check no-cache
        range = [cacheControlHeader rangeOfString: @"no-cache"];
        if (range.location != NSNotFound)
        {
            pragmaNoCacheSet = TRUE;
        }
    }
artifacts commented 13 years ago

You are perfectly right - thanks. Fixed and pushed.