summaryrefslogtreecommitdiff
path: root/content/llcache.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-02-24 20:51:35 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-02-24 20:51:35 +0000
commit4f740f5a32f1bd912009ffbe1bad7515e6fecd7f (patch)
tree28139595715ae3ab7ffd8b725d05beaf1d8232b7 /content/llcache.c
parent9125bd1fa4aa636ec3497fed9a7622257490d383 (diff)
downloadnetsurf-4f740f5a32f1bd912009ffbe1bad7515e6fecd7f.tar.gz
netsurf-4f740f5a32f1bd912009ffbe1bad7515e6fecd7f.tar.bz2
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
Diffstat (limited to 'content/llcache.c')
-rw-r--r--content/llcache.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/content/llcache.c b/content/llcache.c
index 5673a377f..9f9b30f86 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -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;
}
}