Skip to content

Commit 4e79d86

Browse files
trflynn89awesomekling
authored andcommitted
LibWebView: Enable the HTTP disk cache by default
This enables the disk cache and flips the related command line flag to allow disabling it. We've reached a point where it works well, so this will let us get more mileage on it.
1 parent aae8574 commit 4e79d86

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Libraries/LibWebView/Application.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments)
118118
bool disable_site_isolation = false;
119119
bool enable_idl_tracing = false;
120120
bool disable_http_memory_cache = false;
121-
bool enable_http_disk_cache = false;
121+
bool disable_http_disk_cache = false;
122122
bool disable_content_filter = false;
123123
bool enable_autoplay = false;
124124
bool expose_internals_object = false;
@@ -169,7 +169,7 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments)
169169
args_parser.add_option(disable_site_isolation, "Disable site isolation", "disable-site-isolation");
170170
args_parser.add_option(enable_idl_tracing, "Enable IDL tracing", "enable-idl-tracing");
171171
args_parser.add_option(disable_http_memory_cache, "Disable HTTP memory cache", "disable-http-memory-cache");
172-
args_parser.add_option(enable_http_disk_cache, "Enable HTTP disk cache", "enable-http-disk-cache");
172+
args_parser.add_option(disable_http_disk_cache, "Disable HTTP disk cache", "disable-http-disk-cache");
173173
args_parser.add_option(disable_content_filter, "Disable content filter", "disable-content-filter");
174174
args_parser.add_option(enable_autoplay, "Enable multimedia autoplay", "enable-autoplay");
175175
args_parser.add_option(expose_internals_object, "Expose internals object", "expose-internals-object");
@@ -214,8 +214,10 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments)
214214

215215
// Our persisted SQL storage assumes it runs in a singleton process. If we have multiple UI processes accessing
216216
// the same underlying database, one of them is likely to fail.
217-
if (force_new_process)
217+
if (force_new_process) {
218218
disable_sql_database = true;
219+
disable_http_disk_cache = true;
220+
}
219221

220222
if (!dns_server_port.has_value())
221223
dns_server_port = use_dns_over_tls ? 853 : 53;
@@ -262,7 +264,7 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments)
262264

263265
m_request_server_options = {
264266
.certificates = move(certificates),
265-
.http_disk_cache_mode = enable_http_disk_cache ? HTTPDiskCacheMode::Enabled : HTTPDiskCacheMode::Disabled,
267+
.http_disk_cache_mode = disable_http_disk_cache ? HTTPDiskCacheMode::Disabled : HTTPDiskCacheMode::Enabled,
266268
};
267269

268270
m_web_content_options = {

0 commit comments

Comments
 (0)