Karl Seguin
14dcb7895a
Give websockets their own connection pool, improve websocket message logging
2026-04-04 07:00:24 +08:00
Karl Seguin
5733c35a2d
WebSocket WebAPI
...
Uses libcurl's websocket capabilities to add support for WebSocket.
Depends on https://github.com/lightpanda-io/zig-v8-fork/pull/167
Issue: https://github.com/lightpanda-io/browser/issues/1952
This is a WIP because it currently uses the same connection pool used for all
HTTP requests. It would be pretty easy for a page to starve the pool and block
any progress.
We previously stored the *Transfer inside of the easy's private data. We now
store the *Connection, and a Connection now has a `transport` field which is
a union for `http: *Transfer` or `websocket: *Websocket`.
2026-04-04 06:59:28 +08:00
Pierre Tachoire
06fe6c5e7d
Merge pull request #1934 from lightpanda-io/http-cache
...
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / wba-demo-scripts (push) Has been cancelled
e2e-test / wba-test (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig fmt (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
HTTP Caching
2026-04-03 17:11:06 +02:00
Muki Kiboigo
778b7eb8c2
allocate CacheMetadata on use
2026-04-03 07:34:31 -07:00
Muki Kiboigo
ca5fa2b866
change --cache-dir -> --http-cache-dir
2026-04-03 07:23:32 -07:00
Pierre Tachoire
a71ff521aa
cache: add debug log with no store reason
2026-04-03 07:23:32 -07:00
Muki Kiboigo
5a551607c2
better logging on FsCache init failure
2026-04-03 07:23:32 -07:00
Muki Kiboigo
13ea4d1ee3
more expressive cache logging
2026-04-03 07:23:32 -07:00
Muki Kiboigo
dc600c953f
move script queue log before request
2026-04-03 07:23:32 -07:00
Muki Kiboigo
e00d569754
fix crashes on cached file from script manager
2026-04-03 07:23:31 -07:00
Muki Kiboigo
3d760e4577
add format to CachedMetadata
2026-04-03 07:23:31 -07:00
Muki Kiboigo
1e8bdd7e28
assign headers and vary headers before possible move
2026-04-03 07:23:31 -07:00
Muki Kiboigo
31bab4cc05
put in cache before releasing conn
2026-04-03 07:23:31 -07:00
Muki Kiboigo
a1a301666f
dupe url in tryCache
2026-04-03 07:23:31 -07:00
Muki Kiboigo
619a2653d1
update cacheDir config option
2026-04-03 07:23:31 -07:00
Muki Kiboigo
0b9cae5354
fix self.req.ctx in HttpClient
2026-04-03 07:23:31 -07:00
Muki Kiboigo
f098a991a8
remove cache revalidation stubs
2026-04-03 07:23:30 -07:00
Muki Kiboigo
7b5e4d6f52
add Vary support
2026-04-03 07:23:30 -07:00
Muki Kiboigo
9ffc99d6a2
add more FsCache tests
2026-04-03 07:23:30 -07:00
Muki Kiboigo
855c3290ff
always close file on serveFromCache
2026-04-03 07:23:30 -07:00
Muki Kiboigo
d65a4b09f3
better logging for cache
2026-04-03 07:23:30 -07:00
Muki Kiboigo
6a57d69359
switch to single file cache
2026-04-03 07:23:30 -07:00
Muki Kiboigo
9c5e67fbf5
properly deinit cache
2026-04-03 07:23:30 -07:00
Muki Kiboigo
7edb24e54d
use wyhash for power of two lock stripes
2026-04-03 07:23:29 -07:00
Muki Kiboigo
a60932bbe0
require timestamp passed in with cache request
2026-04-03 07:23:29 -07:00
Muki Kiboigo
77e9f5caf7
remove unused cache method on fs cache
2026-04-03 07:23:29 -07:00
Muki Kiboigo
cedc894445
add basic fs cache get/put test
2026-04-03 07:23:29 -07:00
Muki Kiboigo
9d62e58c9a
check age on fs cache get
2026-04-03 07:23:29 -07:00
Muki Kiboigo
609983da87
only store stuff when we know we will cache
2026-04-03 07:23:29 -07:00
Muki Kiboigo
65f77af84d
shortcircuit a lot of caching checks
2026-04-03 07:23:29 -07:00
Muki Kiboigo
cd3e6b2364
ensure fs cache file is closed after use
2026-04-03 07:23:28 -07:00
Muki Kiboigo
557a4458a4
use CacheRequest instead of key
2026-04-03 07:23:28 -07:00
Muki Kiboigo
ce620e208d
add striped lock to FsCache
2026-04-03 07:23:28 -07:00
Muki Kiboigo
2de35a9db2
use arena_pool for cache get
2026-04-03 07:23:28 -07:00
Muki Kiboigo
3eb05fdd1a
use writer for fs cache body file
2026-04-03 07:23:28 -07:00
Muki Kiboigo
186fdee59b
use json for fs cache metadata file
2026-04-03 07:23:28 -07:00
Muki Kiboigo
3c8bb5bc00
use sha256 instead of wyhash
2026-04-03 07:23:28 -07:00
Muki Kiboigo
66d190c047
store type_buf and sub_type_buf in Mime
2026-04-03 07:23:28 -07:00
Muki Kiboigo
5c2207ecc3
add more http caching rules
2026-04-03 07:23:27 -07:00
Muki Kiboigo
18d347e247
use CacheControl and Vary
2026-04-03 07:23:27 -07:00
Muki Kiboigo
29dfbbfdea
cache headers along with response
2026-04-03 07:23:27 -07:00
Muki Kiboigo
02f611bbc8
add basic caching support
2026-04-03 07:23:27 -07:00
Muki Kiboigo
349d5a0a0b
create cache owned by the network struct
2026-04-03 07:23:27 -07:00
Muki Kiboigo
647d989191
use enum approach instead of vtable
2026-04-03 07:23:27 -07:00
Muki Kiboigo
41a24623fa
add basic FsCache impl
2026-04-03 07:23:27 -07:00
Muki Kiboigo
d9a3d912c0
add CachedResponse variant to Response
2026-04-03 07:23:26 -07:00
Muki Kiboigo
070baa8f46
add headerIterator to Http Response
2026-04-03 07:23:26 -07:00
Muki Kiboigo
4f78f299a3
use Response instead of Transfer in callbacks
2026-04-03 07:23:25 -07:00
Muki Kiboigo
9568c86326
allow Mime parse to use []const u8
2026-04-03 07:22:20 -07:00
Muki Kiboigo
6633b6effc
add cache dir to configuration opts
2026-04-03 07:22:20 -07:00