Ensure cache hits after a forced reload -- don't even attempt to reuse objects with the no_cache flag set (as they'll never be considered fresh, thus requiring a round trip to the server every time they're used). Instead, we'll fetch a new object, which will be considered fresh for caching purposes.

svn path=/trunk/netsurf/; revision=11789
This commit is contained in:
John Mark Bell 2011-02-24 20:51:35 +00:00
parent 9125bd1fa4
commit 4f740f5a32

View File

@ -777,9 +777,12 @@ nserror llcache_object_retrieve_from_cache(const char *url, uint32_t flags,
for (obj = llcache_cached_objects; obj != NULL; obj = obj->next) {
bool match;
if (url_compare(obj->url, url, true, &match) == URL_FUNC_OK &&
match == true && (newest == NULL ||
obj->cache.req_time > newest->cache.req_time)) {
if ((newest == NULL ||
obj->cache.req_time > newest->cache.req_time) &&
obj->cache.no_cache == false &&
url_compare(obj->url, url, true,
&match) == URL_FUNC_OK &&
match == true) {
newest = obj;
}
}