Skip to content

Lightpanda: the headless browser designed for AI and automation

use proper default on http_cache_entry_limit option

Muki Kiboigo32364a26dad9
diff --git a/src/Config.zig b/src/Config.zig
index 8bdb18396..fc74e4b23 100644
--- a/src/Config.zig
+++ b/src/Config.zig
@@ -191,7 +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 = "http_cache_entry_limit", .type = ?u32, .default = 1000 },
.{ .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 },
@@ -634,7 +634,7 @@ 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,
+ inline .serve, .fetch, .mcp, .agent => |opts| opts.http_cache_entry_limit.?,
else => 1000,
};
}
diff --git a/src/network/cache/SqliteCache.zig b/src/network/cache/SqliteCache.zig
index 13203a62d..45322e45e 100644
--- a/src/network/cache/SqliteCache.zig
+++ b/src/network/cache/SqliteCache.zig
@@ -126,7 +126,7 @@ pub fn init(allocator: std.mem.Allocator, path: SqliteCachePath, entry_limit: u3
try conn.exec("pragma foreign_keys=on", .{});
}
- log.info(.cache, "sqlite cache initialized", .{ .path = path, .version = version });
+ log.info(.cache, "sqlite cache initialized", .{ .path = path, .entry_limit = entry_limit, .version = version });
return .{ .allocator = allocator, .pool = pool, .entry_limit = entry_limit };
}