Brandon Shelley created USERGRID-1269:
-----------------------------------------

             Summary: Swift SDK - default cache policy loading old data
                 Key: USERGRID-1269
                 URL: https://issues.apache.org/jira/browse/USERGRID-1269
             Project: Usergrid
          Issue Type: Bug
          Components: SDK-iOS
            Reporter: Brandon Shelley
            Assignee: Robert Walsh


Old data is being loaded from cache due to the default caching policy of 
NSURLRequest. Suggest at minimum defaulting to . 
ReloadIgnoringLocalAndRemoteCacheData, recommend adding ability to pass an 
optional NSURLRequestCachePolicy param to all requests.

{code}
    // MARK: - Instance Methods -

    /**
    Constructs a `NSURLRequest` object with this objects instance properties.

    - returns: An initialized and configured `NSURLRequest` object.
    */
    public func buildNSURLRequest() -> NSURLRequest {
        let request = NSMutableURLRequest(URL: self.buildURL())
        request.HTTPMethod = self.method.stringValue
        request.cachePolicy = .ReloadIgnoringLocalAndRemoteCacheData
        self.applyHeaders(request)
        self.applyBody(request)
        self.applyAuth(request)
        return request
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to