add http cache entry limit options

This commit is contained in:
Muki Kiboigo committed 2026-08-06 13:29:05 -07:00
1 parent ce36e3880e
commit e26a200146
2 files changed
+11

No files matched your search

+8
View File
@@ -191,6 +191,7 @@ const CommonOptions = .{
.{ .name = "log_filter_scopes", .type = log.FilterRule, .multiple = true, .validator = logFilterScopesValidator },
.{ .name = "user_agent_suffix", .type = ?[]const u8 },
.{ .name = "http_cache_dir", .type = ?[]const u8 },
.{ .name = "http_cache_entry_limit", .type = ?u32 },
.{ .name = "web_bot_auth_key_file", .type = ?[]const u8 },
.{ .name = "web_bot_auth_keyid", .type = ?[]const u8 },
.{ .name = "web_bot_auth_domain", .type = ?[]const u8 },
@@ -631,6 +632,13 @@ pub fn httpCacheDir(self: *const Config) ?[]const u8 {
};
}
pub fn httpCacheEntryLimit(self: *const Config) u32 {
return switch (self.mode) {
inline .serve, .fetch, .mcp, .agent => |opts| opts.http_cache_entry_limit orelse 1000,
else => 1000,
};
}
pub fn cookieFile(self: *const Config) ?[]const u8 {
return switch (self.mode) {
inline .serve, .fetch, .mcp, .agent => |opts| opts.cookie,
+3
View File
@@ -342,6 +342,9 @@
\\ Directory used as a filesystem cache for network resources. Omitting
\\ this disables caching.
\\ Defaults to no caching.
\\ --http-cache-entry-limit <INT>
\\ Maximum number of entries that can be stored in the HTTP cache. 0 means no limit.
\\ Defaults to 1000.
\\ --http-connect-timeout <INT>
\\ Time in ms to establish an HTTP connection before timing out. 0 means
\\ never.