From 52805a78604f595d523f01bb5c1fa7abd5968c17 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 9 Nov 2019 17:08:43 +0000 Subject: llcache: Allow file and resource schemes to be cached. This means things like the default css file and adblock css file are only loaded and parsed once. --- content/llcache.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'content') diff --git a/content/llcache.c b/content/llcache.c index cd4066210..1e874800c 100644 --- a/content/llcache.c +++ b/content/llcache.c @@ -1792,21 +1792,25 @@ llcache_object_retrieve(nsurl *url, /* POST requests are never cached */ uncachable = true; } else { - /* only http and https schemes are cached */ + /* only http(s), resource, and file schemes are cached */ lwc_string *scheme; bool match; scheme = nsurl_get_component(defragmented_url, NSURL_SCHEME); if (lwc_string_caseless_isequal(scheme, corestring_lwc_http, + &match) == lwc_error_ok && + (match == false) && + lwc_string_caseless_isequal(scheme, corestring_lwc_https, + &match) == lwc_error_ok && + (match == false) && + lwc_string_caseless_isequal(scheme, corestring_lwc_resource, + &match) == lwc_error_ok && + (match == false) && + lwc_string_caseless_isequal(scheme, corestring_lwc_file, &match) == lwc_error_ok && (match == false)) { - if (lwc_string_caseless_isequal(scheme, - corestring_lwc_https, &match) == - lwc_error_ok && - (match == false)) { - uncachable = true; - } + uncachable = true; } lwc_string_unref(scheme); } -- cgit v1.2.3