Skip to content

Lightpanda: the headless browser designed for AI and automation

remove Storage and FsCache

Muki Kiboigob2727a1ab4bd
diff --git a/src/App.zig b/src/App.zig
index 4f6e8dad8..c2141a839 100644
--- a/src/App.zig
+++ b/src/App.zig
@@ -24,7 +24,6 @@ const Snapshot = @import("browser/js/Snapshot.zig");
const Platform = @import("browser/js/Platform.zig");
const Telemetry = @import("telemetry/telemetry.zig").Telemetry;
-const Storage = @import("storage/Storage.zig");
const Network = @import("network/Network.zig");
const Watchdog = @import("Watchdog.zig");
pub const ArenaPool = @import("ArenaPool.zig");
@@ -36,7 +35,6 @@ const App = @This();
network: Network,
config: *const Config,
-storage: Storage,
platform: Platform,
snapshot: Snapshot,
telemetry: Telemetry,
@@ -52,9 +50,6 @@ pub fn init(allocator: Allocator, config: *const Config) !*App {
const snapshot = try Snapshot.load();
errdefer snapshot.deinit();
- var storage = try Storage.init(allocator, config);
- errdefer storage.deinit(allocator);
-
const app = try allocator.create(App);
errdefer allocator.destroy(app);
@@ -63,7 +58,6 @@ pub fn init(allocator: Allocator, config: *const Config) !*App {
.allocator = allocator,
.platform = platform,
.snapshot = snapshot,
- .storage = storage,
.network = undefined,
.app_dir_path = undefined,
.telemetry = undefined,
@@ -105,7 +99,6 @@ pub fn deinit(self: *App) void {
self.snapshot.deinit();
self.platform.deinit();
self.arena_pool.deinit();
- self.storage.deinit(allocator);
allocator.destroy(self);
}
diff --git a/src/Config.zig b/src/Config.zig
index 0bcaa1ac0..55968d4ee 100644
--- a/src/Config.zig
+++ b/src/Config.zig
@@ -23,7 +23,6 @@ const lp = @import("lightpanda");
const cli = @import("cli.zig");
const dump = @import("browser/dump.zig");
-const Storage = @import("storage/Storage.zig");
const WebBotAuthConfig = @import("network/WebBotAuth.zig").Config;
const log = lp.log;
@@ -201,8 +200,6 @@ const CommonOptions = .{
.{ .name = "block_urls", .type = ?[]const u8 },
.{ .name = "cookie", .type = ?[]const u8 },
.{ .name = "cookie_jar", .type = ?[]const u8 },
- .{ .name = "storage_engine", .type = ?Storage.EngineType },
- .{ .name = "storage_sqlite_path", .type = ?[:0]const u8 },
.{ .name = "disable_subframes", .type = bool },
.{ .name = "disable_workers", .type = bool },
.{ .name = "enable_external_stylesheets", .type = bool },
@@ -742,20 +739,6 @@ pub fn cdpMaxHTTPMessageSize(self: *const Config) u14 {
};
}
-pub fn storageEngine(self: *const Config) ?Storage.EngineType {
- return switch (self.mode) {
- inline .serve, .fetch, .mcp, .agent => |opts| opts.storage_engine,
- else => unreachable,
- };
-}
-
-pub fn storageSqlitePath(self: *const Config) ?[:0]const u8 {
- return switch (self.mode) {
- inline .serve, .fetch, .mcp, .agent => |opts| opts.storage_sqlite_path,
- else => unreachable,
- };
-}
-
/// Returns the user-supplied certificate store (`--ca-cert`/`--ca-path`),
/// if any was loaded during argument parsing. The caller takes ownership.
pub fn customCertStore(self: *const Config) ?*crypto.X509_STORE {
diff --git a/src/storage/Blackhole.zig b/src/storage/Blackhole.zig
deleted file mode 100644
index 8da0dc8e5..000000000
--- a/src/storage/Blackhole.zig
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2023-2026 Lightpanda (Selecy SAS)
-//
-// Francis Bouvier <[email protected]>
-// Pierre Tachoire <[email protected]>
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Affero General Public License as
-// published by the Free Software Foundation, either version 3 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Affero General Public License for more details.
-//
-// You should have received a copy of the GNU Affero General Public License
-// along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-const std = @import("std");
-const Allocator = std.mem.Allocator;
-
-const Blackhole = @This();
-
-pub fn deinit(_: *Blackhole, _: Allocator) void {}
diff --git a/src/storage/Storage.zig b/src/storage/Storage.zig
deleted file mode 100644
index 54ac21f3d..000000000
--- a/src/storage/Storage.zig
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (C) 2023-2026 Lightpanda (Selecy SAS)
-//
-// Francis Bouvier <[email protected]>
-// Pierre Tachoire <[email protected]>
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Affero General Public License as
-// published by the Free Software Foundation, either version 3 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Affero General Public License for more details.
-//
-// You should have received a copy of the GNU Affero General Public License
-// along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-const std = @import("std");
-const log = @import("../log.zig");
-const Config = @import("../Config.zig");
-const Blackhole = @import("Blackhole.zig");
-const Sqlite = @import("sqlite/Sqlite.zig");
-
-const Allocator = std.mem.Allocator;
-
-const Storage = @This();
-
-pub const EngineType = enum {
- none,
-};
-
-const Engine = union(EngineType) {
- none: Blackhole,
-};
-
-engine: Engine,
-
-pub fn init(allocator: Allocator, config: *const Config) !Storage {
- const engine_type = config.storageEngine() orelse .none;
- const engine = initEngine(allocator, engine_type, config) catch |err| {
- log.fatal(.storage, "storage setup", .{ .engine = engine_type, .err = err });
- return err;
- };
-
- return .{
- .engine = engine,
- };
-}
-
-fn initEngine(_: Allocator, engine_type: EngineType, _: *const Config) !Engine {
- switch (engine_type) {
- .none => return .{ .none = Blackhole{} },
- }
-}
-
-pub fn deinit(self: *Storage, allocator: Allocator) void {
- switch (self.engine) {
- inline else => |*engine| engine.deinit(allocator),
- }
-}