Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Philippe Jayet
2010-11-16 20:12:15 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
Ben Copsey
2010-11-20 20:26:25 +0800
Commit
b34b3f179421e3020d0a4dacbde40f573b890419
b34b3f17
1 parent
ba984237
Don't use the cached response if the server didn't send an explicit expiration time
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
Classes/ASIDownloadCache.m
Classes/ASIDownloadCache.m
View file @
b34b3f1
...
...
@@ -292,9 +292,9 @@ static NSString *permanentCacheFolder = @"PermanentStore";
// Look for an Expires header to see if the content is out of date
NSString
*
expires
=
[
cachedHeaders
objectForKey
:
@"Expires"
];
if
(
expires
)
{
if
([[
ASIHTTPRequest
dateFromRFC1123String
:
expires
]
timeIntervalSinceNow
]
<
0
)
{
if
([[
ASIHTTPRequest
dateFromRFC1123String
:
expires
]
timeIntervalSinceNow
]
>=
0
)
{
[[
self
accessLock
]
unlock
];
return
NO
;
return
YES
;
}
}
// Look for a max-age header
...
...
@@ -309,13 +309,15 @@ static NSString *permanentCacheFolder = @"PermanentStore";
NSDate
*
expiryDate
=
[[[
NSDate
alloc
]
initWithTimeInterval
:
maxAge
sinceDate
:
fetchDate
]
autorelease
];
if
([
expiryDate
timeIntervalSinceNow
]
<
0
)
{
if
([
expiryDate
timeIntervalSinceNow
]
>=
0
)
{
[[
self
accessLock
]
unlock
];
return
NO
;
return
YES
;
}
}
}
// No explicit expiration time sent by the server
return
NO
;
}
...
...
Please
register
or
login
to post a comment