Skip to content

Commit

Permalink
chore(chrome): add optional cache disable
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Feb 13, 2025
1 parent d259ed5 commit bfffec3
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spider/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider"
version = "2.27.60"
version = "2.27.61"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand Down
2 changes: 1 addition & 1 deletion spider_chrome/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_chrome"
version = "2.27.60"
version = "2.27.61"
rust-version = "1.70"
authors = [
"j-mendez <jeff@spider.cloud>"
Expand Down
2 changes: 2 additions & 0 deletions spider_chrome/src/handler/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ pub struct NetworkManager {
user_cache_disabled: bool,
attempted_authentications: HashSet<RequestId>,
credentials: Option<Credentials>,
// unused atm for remote connections, needs to be used for self launches.
user_request_interception_enabled: bool,
protocol_request_interception_enabled: bool,
offline: bool,
Expand Down Expand Up @@ -257,6 +258,7 @@ impl NetworkManager {
if enabled == self.protocol_request_interception_enabled {
return;
}

self.update_protocol_cache_disabled();

if enabled {
Expand Down
13 changes: 8 additions & 5 deletions spider_chrome/src/handler/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,20 @@ impl Target {
let request_timeout = config.request_timeout;
let mut network_manager = NetworkManager::new(config.ignore_https_errors, request_timeout);

network_manager.set_cache_enabled(config.cache_enabled);
if !config.cache_enabled {
network_manager.set_cache_enabled(false);
}

if !config.service_worker_enabled {
network_manager.set_service_worker_enabled(true);
}

network_manager.set_request_interception(config.request_intercept);

if let Some(ref headers) = config.extra_headers {
network_manager.set_extra_headers(headers.clone());
}

if !config.service_worker_enabled {
network_manager.set_service_worker_enabled(config.service_worker_enabled);
}

network_manager.ignore_visuals = config.ignore_visuals;
network_manager.block_javascript = config.ignore_javascript;
network_manager.block_analytics = config.ignore_analytics;
Expand Down
2 changes: 1 addition & 1 deletion spider_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_cli"
version = "2.27.60"
version = "2.27.61"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand Down
2 changes: 1 addition & 1 deletion spider_transformations/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_transformations"
version = "2.27.60"
version = "2.27.61"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand Down
2 changes: 1 addition & 1 deletion spider_utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_utils"
version = "2.27.60"
version = "2.27.61"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand Down
2 changes: 1 addition & 1 deletion spider_worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_worker"
version = "2.27.60"
version = "2.27.61"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand Down

0 comments on commit bfffec3

Please sign in to comment.